-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Implicit "setup" task from "gather_facts: yes" is missing attributes compared to explicit task #28451
Comments
Some implicit tasks (is the setup task from "gather_facts: yes" the only one?) do not currently have a file reference as documented in an issue upstream [1]. Work around the issue in the meantime and default to the main playbook file if there is no references so that we don't have to handle this edge case. [1]: ansible/ansible#28451 Change-Id: I72526ee47bbe86022c60bc5fd23ca9627f86a4de
the attributes ARE there, they are just not set, they should be set to the play that triggers it. |
Some implicit tasks (is the setup task from "gather_facts: yes" the only one?) do not currently have a file reference as documented in an issue upstream [1]. Work around the issue in the meantime and default to the main playbook file if there is no references so that we don't have to handle this edge case. [1]: ansible/ansible#28451 Change-Id: I72526ee47bbe86022c60bc5fd23ca9627f86a4de (cherry picked from commit 24439f6)
cc @david_obrien |
@dmsimard As @bcoca mentioned, It has a BEFORE:
AFTER:
You can get the attributes in a roundabout way with a callback like so:
RUN (your playbook):
|
ISSUE TYPE
COMPONENT NAME
setup
ANSIBLE VERSION
CONFIGURATION
Not relevant
OS / ENVIRONMENT
Not relevant
SUMMARY
The implicit setup task that is issued from gather_facts differs from an explicit setup task.
The explicit setup task has a data source which makes task.get_path() (amongst other things) work.
Looking at the
get_path
method, you can see that we are expecting the task to have a_ds
,_data_source
and_line_number
attributes .STEPS TO REPRODUCE
We can reproduce this issue with a simple callback:
And the following playbook:
EXPECTED RESULTS
I expect the gather_facts implicit setup task to have the same parameters and attributes as an explicit task.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: