/ansible-nginx-config/templates/core.j2", line 323, in macro TypeError: sequence item 9: expected str instance, Undefined found During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/ansible/plugins/action/template.py", line 141, in run resultant = templar.do_template(template_data, preserve_trailing_newlines=True, escape_backslashes=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/ansible/template/__init__.py", line 998, in do_template raise AnsibleError("Unexpected templating type error occurred on (%s): %s" % (to_native(data), to_native(te)), orig_exc=te) ansible.errors.AnsibleError: Unexpected templating type error occurred on ({{ ansible_managed | comment }} {% if nginx_config_main_template['config']['main'] is defined %} {% from 'core.j2' import main with context %} {{ main(nginx_config_main_template['config']['main']) }} {%- endif %} {% if nginx_config_main_template['config']['include'] is defined and nginx_config_main_template['config']['include'] is not mapping %} {% for file in nginx_config_main_template['config']['include'] if nginx_config_main_template['config']['include'] is not string %} include {{ file }}; {% else %} include {{ nginx_config_main_template['config']['include'] }}; {% endfor %} {%- endif %} events { {% if nginx_config_main_template['config']['events'] is defined %} {% from 'core.j2' import events with context %} {% filter indent(4) %} {{ events(nginx_config_main_template['config']['events']) }} {%- endfilter %} {% endif %} } {% if nginx_config_main_template['config']['http'] is defined %} http { {% if nginx_config_main_template['config']['http']['include'] is defined and nginx_config_main_template['config']['http']['include'] is not mapping %} {% for file in nginx_config_main_template['config']['http']['include'] if nginx_config_main_template['config']['http']['include'] is not string %} include {{ file }}; {% else %} include {{ nginx_config_main_template['config']['http']['include'] }}; {% endfor %} {% endif %} } {% endif %} {% if nginx_config_main_template['config']['stream'] is defined %} stream { {% if nginx_config_main_template['config']['stream']['include'] is defined and nginx_config_main_template['config']['stream']['include'] is not mapping %} {% for file in nginx_config_main_template['config']['stream']['include'] if nginx_config_main_template['config']['stream']['include'] is not string %} include {{ file }}; {% else %} include {{ nginx_config_main_template['config']['stream']['include'] }}; {% endfor %} {% endif %} } {% endif %} ): sequence item 9: expected str instance, Undefined found. sequence item 9: expected str instance, Undefined found fatal: [servertest-A]: FAILED! => { "changed": false, "msg": "AnsibleError: Unexpected templating type error occurred on ({{ ansible_managed | comment }}\n\n{% if nginx_config_main_template['config']['main'] is defined %}\n{% from 'core.j2' import main with context %}\n{{ main(nginx_config_main_template['config']['main']) }}\n{%- endif %}\n\n{% if nginx_config_main_template['config']['include'] is defined and nginx_config_main_template['config']['include'] is not mapping %}\n{% for file in nginx_config_main_template['config']['include'] if nginx_config_main_template['config']['include'] is not string %}\ninclude {{ file }};\n{% else %}\ninclude {{ nginx_config_main_template['config']['include'] }};\n{% endfor %}\n{%- endif %}\n\nevents {\n{% if nginx_config_main_template['config']['events'] is defined %}\n{% from 'core.j2' import events with context %}\n{% filter indent(4) %}\n {{ events(nginx_config_main_template['config']['events']) }}\n{%- endfilter %}\n{% endif %}\n}\n\n{% if nginx_config_main_template['config']['http'] is defined %}\nhttp {\n{% if nginx_config_main_template['config']['http']['include'] is defined and nginx_config_main_template['config']['http']['include'] is not mapping %}\n{% for file in nginx_config_main_template['config']['http']['include'] if nginx_config_main_template['config']['http']['include'] is not string %}\n include {{ file }};\n{% else %}\n include {{ nginx_config_main_template['config']['http']['include'] }};\n{% endfor %}\n{% endif %}\n}\n{% endif %}\n\n{% if nginx_config_main_template['config']['stream'] is defined %}\nstream {\n{% if nginx_config_main_template['config']['stream']['include'] is defined and nginx_config_main_template['config']['stream']['include'] is not mapping %}\n{% for file in nginx_config_main_template['config']['stream']['include'] if nginx_config_main_template['config']['stream']['include'] is not string %}\n include {{ file }};\n{% else %}\n include {{ nginx_config_main_template['config']['stream']['include'] }};\n{% endfor %}\n{% endif %}\n}\n{% endif %}\n): sequence item 9: expected str instance, Undefined found. sequence item 9: expected str instance, Undefined found" }