New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to access ansible_failed_task
attributes if at least one contains a template
#74036
Comments
Files identified in the description: If these files are incorrect, please update the |
!component lib/ansible/plugins/strategy/init.py |
!component =lib/ansible/plugins/strategy |
Files identified in the description:
If these files are incorrect, please update the |
This should be fixed in The PR that fixes the issue is #73881. Backport PRs for 2.9 and 2.10 releases were created. needs_info |
@mkrizek yes, same issue on latest
|
ansible_failed_task
attributes if at least one contains a template
This is related to #56345 (comment) Effectively a templating error should not be recoverable. But we currently lack the right mechanism to convey that from the worker back into the main process. Short term, we probably should use |
@sivel not sure about unrecoverable part. We got to this problem, by trying to safe-guard any potential issues with roles loaded using Anyway, I briefly made a fix as suggested:
this doesn't cause the failure anymore (assuming I understood correctly following):
|
* Prevent ansible_failed_task from further templating Fixes #74036 * Add changelog
* Prevent ansible_failed_task from further templating Fixes ansible#74036 * Add changelog (cherry picked from commit 664531d)
v2.10.9 Major Changes - ansible-test - Tests run with the ``centos6`` and ``default`` test containers now use a PyPI proxy container to access PyPI when Python 2.6 is used. This allows tests running under Python 2.6 to continue functioning even though PyPI is discontinuing support for non-SNI capable clients. Minor Changes - Switch to hashlib.sha256() for ansible-test to allow for FIPs mode. Bugfixes - Prevent ``ansible_failed_task`` from further templating (ansible/ansible#74036) - ansible-test - Avoid publishing the port used by the ``pypi-test-container`` since it is only accessed by other containers. This avoids issues when trying to run tests in parallel on a single host. - ansible-test - Fix docker container IP address detection. The ``bridge`` network is no longer assumed to be the default. - ansible-test - ensure the correct unit test target is given when the ``__init__.py`` file is modified inside the connection plugins directory - ansible.utils.encrypt now handles missing or unusable 'crypt' library. - facts - detect homebrew installed at /opt/homebrew/bin/brew - interpreter discovery - Debian 8 and lower will avoid unsupported Python3 version in interpreter discovery - undeprecate hash_merge setting and add more docs clarifying its use and why not to use it. - wait_for module, move missing socket into function to get proper comparrison in time.
…ible#74290) * Prevent ansible_failed_task from further templating Fixes ansible#74036 * Add changelog. (cherry picked from commit 664531d) Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
Summary
Unable to access
ansible_failed_task
attributes if at least one contains a templateLooks like Ansible recursively processes templates inside
rescue
block when trying to access values inansible_failed_task
variable.Issue Type
Bug Report
Component Name
block, rescue, ansible_failed_task
Ansible Version
Configuration
OS / Environment
Fedora release 33 (Thirty Three)
Steps to Reproduce
Expected Results
The task in
rescue
should end successfully and print the name ofaction
module which led to failuresActual Results
The text was updated successfully, but these errors were encountered: