diff options
author | Brian Coca <brian.coca+git@gmail.com> | 2016-10-03 19:24:37 -0400 |
---|---|---|
committer | Brian Coca <brian.coca+git@gmail.com> | 2016-10-03 19:24:37 -0400 |
commit | 54ce6a9b7a7d2b1d4dc712c74f58fda5f55a780a (patch) | |
tree | eeb94d8733dfa7198af6cc3eafc0b5deed7343e0 /lib/ansible/playbook | |
parent | d4b2ea3ec8f5a5fb1364b1f088b311bf4cca2f6f (diff) | |
download | ansible-54ce6a9b7a7d2b1d4dc712c74f58fda5f55a780a.tar.gz |
fix for include_role conflating vars/directives
Diffstat (limited to 'lib/ansible/playbook')
-rw-r--r-- | lib/ansible/playbook/role_include.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ansible/playbook/role_include.py b/lib/ansible/playbook/role_include.py index e67d0d7f0e..f6737c0793 100644 --- a/lib/ansible/playbook/role_include.py +++ b/lib/ansible/playbook/role_include.py @@ -92,22 +92,25 @@ class IncludeRole(Task): ir = IncludeRole(block, role, task_include=task_include).load_data(data, variable_manager=variable_manager, loader=loader) + # deal with options + + # name is needed ir._role_name = ir.args.get('name') if ir._role_name is None: raise AnsibleParserError("'name' is a required field.") - # set built in's - attributes = frozenset(ir._valid_attrs.keys()) - for builtin in attributes: - if ir.args.get(builtin): - setattr(ir, builtin, ir.args.get(builtin)) - # build options for role includes for key in ['tasks', 'vars', 'defaults']: from_key = key + '_from' if ir.args.get(from_key): ir._from_files[key] = basename(ir.args.get(from_key)) + #TODO: find a way to make this list come from object ( attributes does not work as per below) + # manual list as otherwise the options would set other task parameters we don't want. + for option in ['static', 'private']: + if option in ir.args: + setattr(ir, option, ir.args.get(option)) + return ir.load_data(data, variable_manager=variable_manager, loader=loader) def copy(self, exclude_parent=False, exclude_tasks=False): |