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
20a48c6b
Commit
20a48c6b
authored
Mar 28, 2013
by
Junegunn Choi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
terminate immediately on a failure
parent
4552fa85
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
lib/ansible/playbook/__init__.py
+6
-1
lib/ansible/playbook/play.py
+4
-2
lib/ansible/playbook/task.py
+5
-2
No files found.
lib/ansible/playbook/__init__.py
View file @
20a48c6b
...
...
@@ -63,7 +63,8 @@ class PlayBook(object):
subset
=
C
.
DEFAULT_SUBSET
,
inventory
=
None
,
check
=
False
,
diff
=
False
):
diff
=
False
,
any_errors_fatal
=
False
):
"""
playbook: path to a playbook file
...
...
@@ -113,6 +114,7 @@ class PlayBook(object):
self
.
global_vars
=
{}
self
.
private_key_file
=
private_key_file
self
.
only_tags
=
only_tags
self
.
any_errors_fatal
=
any_errors_fatal
self
.
callbacks
.
playbook
=
self
self
.
runner_callbacks
.
playbook
=
self
...
...
@@ -464,6 +466,9 @@ class PlayBook(object):
host_list
=
self
.
_list_available_hosts
(
play
.
hosts
)
if
task
.
any_errors_fatal
and
len
(
self
.
stats
.
failures
)
>
0
:
host_list
=
None
# if no hosts remain, drop out
if
not
host_list
:
self
.
callbacks
.
on_no_hosts_remaining
()
...
...
lib/ansible/playbook/play.py
View file @
20a48c6b
...
...
@@ -30,7 +30,7 @@ class Play(object):
'handlers'
,
'remote_user'
,
'remote_port'
,
'sudo'
,
'sudo_user'
,
'transport'
,
'playbook'
,
'tags'
,
'gather_facts'
,
'serial'
,
'_ds'
,
'_handlers'
,
'_tasks'
,
'basedir'
'basedir'
,
'any_errors_fatal'
]
# to catch typos and so forth -- these are userland names
...
...
@@ -38,7 +38,8 @@ class Play(object):
VALID_KEYS
=
[
'hosts'
,
'name'
,
'vars'
,
'vars_prompt'
,
'vars_files'
,
'tasks'
,
'handlers'
,
'user'
,
'port'
,
'include'
,
'sudo'
,
'sudo_user'
,
'connection'
,
'tags'
,
'gather_facts'
,
'serial'
'sudo'
,
'sudo_user'
,
'connection'
,
'tags'
,
'gather_facts'
,
'serial'
,
'any_errors_fatal'
]
# *************************************************
...
...
@@ -77,6 +78,7 @@ class Play(object):
self
.
gather_facts
=
ds
.
get
(
'gather_facts'
,
None
)
self
.
serial
=
int
(
utils
.
template
(
basedir
,
ds
.
get
(
'serial'
,
0
),
self
.
vars
))
self
.
remote_port
=
utils
.
template
(
basedir
,
self
.
remote_port
,
self
.
vars
)
self
.
any_errors_fatal
=
ds
.
get
(
'any_errors_fatal'
,
False
)
self
.
_update_vars_files_for_host
(
None
)
...
...
lib/ansible/playbook/task.py
View file @
20a48c6b
...
...
@@ -27,7 +27,8 @@ class Task(object):
'play'
,
'notified_by'
,
'tags'
,
'register'
,
'delegate_to'
,
'first_available_file'
,
'ignore_errors'
,
'local_action'
,
'transport'
,
'sudo'
,
'sudo_user'
,
'sudo_pass'
,
'items_lookup_plugin'
,
'items_lookup_terms'
,
'environment'
,
'args'
'items_lookup_plugin'
,
'items_lookup_terms'
,
'environment'
,
'args'
,
'any_errors_fatal'
]
# to prevent typos and such
...
...
@@ -35,7 +36,8 @@ class Task(object):
'name'
,
'action'
,
'only_if'
,
'async'
,
'poll'
,
'notify'
,
'first_available_file'
,
'include'
,
'tags'
,
'register'
,
'ignore_errors'
,
'delegate_to'
,
'local_action'
,
'transport'
,
'sudo'
,
'sudo_user'
,
'sudo_pass'
,
'when'
,
'connection'
,
'environment'
,
'args'
'sudo_pass'
,
'when'
,
'connection'
,
'environment'
,
'args'
,
'any_errors_fatal'
]
def
__init__
(
self
,
play
,
ds
,
module_vars
=
None
,
additional_conditions
=
None
):
...
...
@@ -151,6 +153,7 @@ class Task(object):
self
.
ignore_errors
=
ds
.
get
(
'ignore_errors'
,
False
)
self
.
any_errors_fatal
=
ds
.
get
(
'any_errors_fatal'
,
play
.
any_errors_fatal
)
# action should be a string
if
not
isinstance
(
self
.
action
,
basestring
):
...
...
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