You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This is not really a bug but something to be aware of.
Describe the bug
When you run ansible-playbook --check on a playbook that includes the nginxinc.nginx role it will fail on the Verify that you are using a supported Jinja2 version on your Ansible host task with this error:
fatal: [somehost -> localhost]: FAILED! => {"msg": "Unexpected templating type error occurred on (Jinja2 {{ jinja2_version['stdout'] | regex_search('jinja version = ([\\d.]+)', '\\1') | first }} is supported.): 'NoneType' object is not iterable. 'NoneType' object is not iterable"}
The root cause for this isn't a missing package but rather that ansible --version refuses to run in check mode.
To reproduce
Create a new playbook repro.yml like so:
- name: Repro
hosts: somehost
tasks:
- name: Extract the version of Jinja2 installed on your Ansible host
ansible.builtin.command: ansible --version
register: jinja2_version
changed_when: false
delegate_to: localhost
become: false
- name: Debug
ansible.builtin.debug:
msg: "{{ jinja2_version }}"
Now run ansible-playbook --check repro.yml and observe the output:
TASK [Debug] ***************************************************************
ok: [somehost] => {
"msg": {
"changed": false,
"cmd": [
"ansible",
"--version"
],
"delta": null,
"end": null,
"failed": false,
"msg": "Command would have run if not in check mode",
"rc": 0,
"skipped": true,
"start": null,
"stderr": "",
"stderr_lines": [],
"stdout": "",
"stdout_lines": []
}
}
here you'll see that stdout is empty and msg indicates that: Command would have run if not in check mode
Expected behavior
The check passes.
Potential resolution
If the Jinja2 version check could obtain the version without running ansible directly (and hitting the --check switch) that would resolve this problem.
However that may or may not be possible so it's most likely something that is not relevant to this role.
The text was updated successfully, but these errors were encountered:
Note: This is not really a bug but something to be aware of.
Describe the bug
When you run
ansible-playbook --check
on a playbook that includes the nginxinc.nginx role it will fail on theVerify that you are using a supported Jinja2 version on your Ansible host
task with this error:The root cause for this isn't a missing package but rather that
ansible --version
refuses to run in check mode.To reproduce
Create a new playbook
repro.yml
like so:Now run
ansible-playbook --check repro.yml
and observe the output:here you'll see that
stdout
is empty andmsg
indicates that:Command would have run if not in check mode
Expected behavior
The check passes.
Potential resolution
If the Jinja2 version check could obtain the version without running ansible directly (and hitting the --check switch) that would resolve this problem.
However that may or may not be possible so it's most likely something that is not relevant to this role.
The text was updated successfully, but these errors were encountered: