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
302cc37c
Commit
302cc37c
authored
Feb 27, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mpdehaan/ansible
parents
2860c14b
4a3a5fb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
examples/playbook.yml
+3
-0
lib/ansible/playbook.py
+8
-0
lib/ansible/runner.py
+3
-2
No files found.
examples/playbook.yml
View file @
302cc37c
...
@@ -15,6 +15,9 @@
...
@@ -15,6 +15,9 @@
-
name
:
execute bin
false
-
name
:
execute bin
false
comment
:
call something that will fail just to demo failure counts and such
comment
:
call something that will fail just to demo failure counts and such
action
:
command /bin/false
action
:
command /bin/false
-
name
:
execute bin
true
comment
:
this will never be executed because previous will fail
action
:
command /bin/true
handlers
:
handlers
:
-
name
:
restart apache
-
name
:
restart apache
action
:
service name=httpd state=restarted
action
:
service name=httpd state=restarted
lib/ansible/playbook.py
View file @
302cc37c
...
@@ -110,6 +110,14 @@ class PlayBook(object):
...
@@ -110,6 +110,14 @@ class PlayBook(object):
# actions where not all hosts have changed
# actions where not all hosts have changed
# though top-level tasks will pass in "None" here
# though top-level tasks will pass in "None" here
host_list
=
self
.
host_list
host_list
=
self
.
host_list
host_list
=
ansible
.
runner
.
Runner
.
parse_hosts
(
host_list
)
# do not continue to run tasks on hosts that have had failures
new_hosts
=
[]
for
x
in
host_list
:
if
not
self
.
failures
.
has_key
(
x
):
new_hosts
.
append
(
x
)
host_list
=
new_hosts
# load the module name and parameters from the task
# load the module name and parameters from the task
# entry
# entry
...
...
lib/ansible/runner.py
View file @
302cc37c
...
@@ -66,7 +66,7 @@ class Runner(object):
...
@@ -66,7 +66,7 @@ class Runner(object):
'''
'''
# save input values
# save input values
self
.
host_list
=
self
.
_
parse_hosts
(
host_list
)
self
.
host_list
=
self
.
parse_hosts
(
host_list
)
self
.
module_path
=
module_path
self
.
module_path
=
module_path
self
.
module_name
=
module_name
self
.
module_name
=
module_name
self
.
forks
=
forks
self
.
forks
=
forks
...
@@ -78,7 +78,8 @@ class Runner(object):
...
@@ -78,7 +78,8 @@ class Runner(object):
self
.
remote_pass
=
remote_pass
self
.
remote_pass
=
remote_pass
self
.
_tmp_paths
=
{}
self
.
_tmp_paths
=
{}
def
_parse_hosts
(
self
,
host_list
):
@classmethod
def
parse_hosts
(
cls
,
host_list
):
''' parse the host inventory file if not sent as an array '''
''' parse the host inventory file if not sent as an array '''
# if the host list is given as a string load the host list
# if the host list is given as a string load the host list
...
...
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