diff options
Diffstat (limited to 'app-admin/ansible/files/ansible-include-role.patch')
-rw-r--r-- | app-admin/ansible/files/ansible-include-role.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/app-admin/ansible/files/ansible-include-role.patch b/app-admin/ansible/files/ansible-include-role.patch new file mode 100644 index 0000000..5ef7967 --- /dev/null +++ b/app-admin/ansible/files/ansible-include-role.patch @@ -0,0 +1,34 @@ +diff -dPNur ansible-2.4.3.0/lib/ansible/playbook/included_file.py ansible-2.4.3.0-new2/lib/ansible/playbook/included_file.py +--- ansible-2.4.3.0/lib/ansible/playbook/included_file.py 2018-02-01 00:09:48.000000000 +0100 ++++ ansible-2.4.3.0-new2/lib/ansible/playbook/included_file.py 2018-03-21 13:39:25.259172590 +0100 +@@ -134,6 +134,17 @@ + include_file = templar.template(include_file) + inc_file = IncludedFile(include_file, include_variables, original_task) + else: ++ # template the included role's name here ++ role_name = include_variables.get('name', include_variables.get('role', None)) ++ if role_name is not None: ++ role_name = templar.template(role_name) ++ ++ original_task._role_name = role_name ++ for from_arg in original_task.FROM_ARGS: ++ if from_arg in include_variables: ++ from_key = from_arg.replace('_from', '') ++ original_task._from_files[from_key] = templar.template(include_variables[from_arg]) ++ + inc_file = IncludedFile("role", include_variables, original_task, is_role=True) + + try: +diff -dPNur ansible-2.4.3.0/lib/ansible/plugins/strategy/free.py ansible-2.4.3.0-new2/lib/ansible/plugins/strategy/free.py +--- ansible-2.4.3.0/lib/ansible/plugins/strategy/free.py 2018-02-01 00:09:48.000000000 +0100 ++++ ansible-2.4.3.0-new2/lib/ansible/plugins/strategy/free.py 2018-03-21 13:39:25.259172590 +0100 +@@ -197,7 +197,7 @@ + new_ir = included_file._task.copy() + new_ir.vars.update(included_file._args) + +- new_blocks, handler_blocks = new_ir.get_block_list( ++ new_blocks, handler_blocks = included_file._task.get_block_list( + play=iterator._play, + variable_manager=self._variable_manager, + loader=self._loader, +diff -dPNur ansible-2.4.3.0/lib/ansible/plugins/strategy/free.py.orig ansible-2.4.3.0-new2/lib/ansible/plugins/strategy/free.py.orig |