Bug: setup node fails
Description
The Task "setup_node" fails every time when it is used in a playbook (e.g. "setup_cloud.yml"), because the regular expression "(.*)" used in the playbook filter "map" matches strings twice instead of once in certain python versions. [1]
Environment
Operating System: Ubuntu 20.04
Python Version: 3.8.10
Messages
Error
TASK [setup_node : Create setup node] ********************************************************************************************************************************************************************************************************************************************************************************task path: ~/projects/ossdip/roles/setup_node/tasks/main.yml:54 The full traceback is: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/ansible/executor/task_executor.py", line 504, in _execute self._task.post_validate(templar=templar) File "/usr/lib/python3/dist-packages/ansible/playbook/task.py", line 285, in post_validate super(Task, self).post_validate(templar) File "/usr/lib/python3/dist-packages/ansible/playbook/base.py", line 650, in post_validate value = templar.template(getattr(self, name)) File "/usr/lib/python3/dist-packages/ansible/template/__init__.py", line 913, in template d[k] = self.template( File "/usr/lib/python3/dist-packages/ansible/template/__init__.py", line 869, in template result = self.do_template( File "/usr/lib/python3/dist-packages/ansible/template/__init__.py", line 1139, in do_template res = j2_concat(rf) File "<template>", line 14, in root File "/usr/lib/python3/dist-packages/ansible/template/__init__.py", line 300, in wrapper return list(ret) File "/usr/lib/python3/dist-packages/jinja2/filters.py", line 968, in do_map yield func(item) File "/usr/lib/python3/dist-packages/jinja2/filters.py", line 1102, in <lambda> func = lambda item: context.environment.call_filter( File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 467, in call_filter return func(*args, **(kwargs or {})) File "/usr/lib/python3/dist-packages/ansible/template/__init__.py", line 298, in wrapper ret = func(*args, **kwargs) File "/usr/lib/python3/dist-packages/ansible/plugins/filter/core.py", line 124, in regex_replace return _re.sub(replacement, value) File "/usr/lib/python3.8/re.py", line 327, in _subx template = _compile_repl(template, pattern) File "/usr/lib/python3.8/re.py", line 318, in _compile_repl return sre_parse.parse_template(repl, pattern) File "/usr/lib/python3.8/sre_parse.py", line 1036, in parse_template addgroup(int(this[1:]), len(this) - 1) File "/usr/lib/python3.8/sre_parse.py", line 980, in addgroup raise s.error("invalid group reference %d" % index, pos) re.error: invalid group reference 1 at position 22 fatal: [localhost]: FAILED! => { "changed": false }