diff options
author | James Cammarata <jimi@sngx.net> | 2015-04-17 13:00:25 -0500 |
---|---|---|
committer | James Cammarata <jimi@sngx.net> | 2015-04-17 13:02:09 -0500 |
commit | f4172fb9daf27baaedd63d1f67ad072b2263d9e7 (patch) | |
tree | 515199bad221d1ee48732cf176e462a86ed5506f /lib | |
parent | 65be14e8b4ceb56bd08b30c398309ae322d5271a (diff) | |
download | ansible-f4172fb9daf27baaedd63d1f67ad072b2263d9e7.tar.gz |
Fix tag handling on meta:flush_handlers tasks
Fixes #10758
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ansible/playbook/play.py | 12 | ||||
-rw-r--r-- | lib/ansible/playbook/task.py | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 9fd8a86f4e..665f1ef091 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -590,15 +590,17 @@ class Play(object): included_become_vars[k] = become_vars[k] x[k] = become_vars[k] - if 'meta' in x: - if x['meta'] == 'flush_handlers': - results.append(Task(self, x)) - continue - task_vars = vars.copy() if original_file: task_vars['_original_file'] = original_file + if 'meta' in x: + if x['meta'] == 'flush_handlers': + if role_name and 'role_name' not in x: + x['role_name'] = role_name + results.append(Task(self, x, module_vars=task_vars, role_name=role_name)) + continue + if 'include' in x: tokens = split_args(str(x['include'])) included_additional_conditions = list(additional_conditions) diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index b8b58f1c0b..70c1bc8df6 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -52,6 +52,8 @@ class Task(object): if 'meta' in ds: self.meta = ds['meta'] self.tags = [] + self.module_vars = module_vars + self.role_name = role_name return else: self.meta = None |