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
I understand that AWX is open source software provided for free and that I might not receive a timely response.
I am NOT reporting a (potential) security vulnerability. (These should be emailed to [email protected] instead.)
Bug Summary
When using the file lookup plugin to template a files contents the AWX job fails even with the errors='ignore'
We've setup a mechanism to add file contents to templates based on the presence of a file in directory. When the template step is defined in the playbook the errors (if a file is not found) are ignored (i.e. ...ignoring) however if the template step is defined in a role errors are not ignored.
Execute the templating-role tasks using the include-role module
Expected results
An error is thrown because the absent_variables_file is not found but is ignored and the job completes successfully.
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleError: An unhandled exception occurred while templating '{{ lookup('file', absent_variables_file, errors='ignore') }}'. Error was a <class 'ansible.errors.AnsibleOptionsError'>, original message: The 'file' lookup had an issue accessing the file '/runner/requirements_roles/sdp-tide-platform/files/bug-report/absent_variables.yml'. file not found, use -vvvvv to see paths searched
failed: [content-legislation-vic-gov-au-develop] (item={'root': '/runner/requirements_roles/sdp-tide-platform/files/bug-report/templates', 'path': '.test.yml.j2', 'state': 'file', 'src': '/runner/requirements_roles/sdp-tide-platform/files/bug-report/templates/.test.yml.j2', 'uid': 1000, 'gid': 0, 'owner': '1000', 'group': 'root', 'mode': '0777', 'size': 80, 'mtime': 1712035704.0, 'ctime': 1712035852.2879279}) => {"ansible_loop_var": "item", "changed": false, "item": {"ctime": 1712035852.2879279, "gi…
...ignoring
Actual results
An error is thrown and the job fails.
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleError: An unhandled exception occurred while templating '{{ lookup('file', absent_variables_file, errors='ignore') }}'. Error was a <class 'ansible.errors.AnsibleOptionsError'>, original message: The 'file' lookup had an issue accessing the file '/runner/requirements_roles/sdp-tide-platform/files/bug-report/absent_variables.yml'. file not found, use -vvvvv to see paths searched
failed: [content-legislation-vic-gov-au-develop] (item={'root': '/runner/requirements_roles/sdp-tide-platform/files/bug-report/templates', 'path': '.test.yml.j2', 'state': 'file', 'src': '/runner/requirements_roles/sdp-tide-platform/files/bug-report/templates/.test.yml.j2', 'uid': 1000, 'gid': 0, 'owner': '1000', 'group': 'root', 'mode': '0777', 'size': 80, 'mtime': 1712032380.0, 'ctime': 1712034523.8676915}) => {"ansible_loop_var": "item", "changed": false, "item": {"ctime": 1712034523.8676915, "gi…
Additional information
No response
The text was updated successfully, but these errors were encountered:
@GROwen do you experience this issue when running the playbook directly from command line (not through awx)? ideally using exact same ansible and collections modules versions
Please confirm the following
[email protected]
instead.)Bug Summary
When using the file lookup plugin to template a files contents the AWX job fails even with the
errors='ignore'
We've setup a mechanism to add file contents to templates based on the presence of a file in directory. When the template step is defined in the playbook the errors (if a file is not found) are ignored (i.e.
...ignoring
) however if the template step is defined in a role errors are not ignored.I've pushed a scaffold to https://github.com/GROwen/awx-errors-not-ignored but also outlined it below.
Structure
File contents
This mechanism has worked until recently
AWX version
AWX 23.6.0
Select the relevant components
Installation method
kubernetes
Modifications
no
Ansible version
2.13.6
Operating system
Debian GNU/Linux 12 (bookworm)
Web browser
Safari
Steps to reproduce
templating-role
tasks using theinclude-role
moduleExpected results
An error is thrown because the
absent_variables_file
is not found but is ignored and the job completes successfully.Actual results
An error is thrown and the job fails.
Additional information
No response
The text was updated successfully, but these errors were encountered: