Merge branch 'master' of github.com:mpdehaan/ansible

This commit is contained in:
Michael DeHaan 2012-02-27 22:43:21 -05:00
commit 302cc37c79
3 changed files with 14 additions and 2 deletions

View file

@ -15,6 +15,9 @@
- name: execute bin false
comment: call something that will fail just to demo failure counts and such
action: command /bin/false
- name: execute bin true
comment: this will never be executed because previous will fail
action: command /bin/true
handlers:
- name: restart apache
action: service name=httpd state=restarted

View file

@ -110,6 +110,14 @@ class PlayBook(object):
# actions where not all hosts have changed
# though top-level tasks will pass in "None" here
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
# entry

View file

@ -66,7 +66,7 @@ class Runner(object):
'''
# 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_name = module_name
self.forks = forks
@ -78,7 +78,8 @@ class Runner(object):
self.remote_pass = remote_pass
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 '''
# if the host list is given as a string load the host list