Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
d9be910e
Commit
d9be910e
authored
Aug 22, 2013
by
James Cammarata
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'exit-3-on-dark' of
https://github.com/j2sol/ansible
into j2sol-exit-3-on-dark
parents
c32467b5
2b96c347
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
bin/ansible
+1
-1
bin/ansible-playbook
+10
-3
No files found.
bin/ansible
View file @
d9be910e
...
...
@@ -159,7 +159,7 @@ if __name__ == '__main__':
if
'failed'
in
result
or
result
.
get
(
'rc'
,
0
)
!=
0
:
sys
.
exit
(
2
)
if
results
[
'dark'
]:
sys
.
exit
(
2
)
sys
.
exit
(
3
)
except
errors
.
AnsibleError
,
e
:
# Generic handler for ansible specific errors
callbacks
.
display
(
"ERROR:
%
s"
%
str
(
e
),
stderr
=
True
,
color
=
'red'
)
...
...
bin/ansible-playbook
View file @
d9be910e
...
...
@@ -201,6 +201,7 @@ def main(args):
return
0
failed_hosts
=
[]
unreachable_hosts
=
[]
try
:
...
...
@@ -212,11 +213,15 @@ def main(args):
for
h
in
hosts
:
t
=
pb
.
stats
.
summarize
(
h
)
if
t
[
'
unreachable'
]
>
0
or
t
[
'
failures'
]
>
0
:
if
t
[
'failures'
]
>
0
:
failed_hosts
.
append
(
h
)
if
t
[
'unreachable'
]
>
0
:
unreachable_hosts
.
append
(
h
)
if
len
(
failed_hosts
)
>
0
:
filename
=
pb
.
generate_retry_inventory
(
failed_hosts
)
retries
=
failed_hosts
+
unreachable_hosts
if
len
(
retries
)
>
0
:
filename
=
pb
.
generate_retry_inventory
(
retries
)
if
filename
:
display
(
" to retry, use: --limit @
%
s
\n
"
%
filename
)
...
...
@@ -245,6 +250,8 @@ def main(args):
print
""
if
len
(
failed_hosts
)
>
0
:
return
2
if
len
(
unreachable_hosts
)
>
0
:
return
3
except
errors
.
AnsibleError
,
e
:
display
(
"ERROR:
%
s"
%
e
,
color
=
'red'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment