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
in 2.0.1.0 and later, skipped plays impact gathering=smart #15744
Comments
I think the solution is to not set
And for 2.0.1.0 I think that means:
These changes seem to result in the appropriate behavior. |
In `lib/ansible/executor/play_iterator.py`, ansible sets a host's `_gathered_facts` property to `True` without checking to see if there are any tasks to be executed. In the event that the entire play is skipped, `_gathered_facts` will be `True` even though the `setup` module was never run. This patch modifies the logic to only set `_gathered_facts` to `True` when there are tasks to execute. Closes ansible#15744.
With the above patch in place, running the above reproducer correctly results in:
|
In `lib/ansible/executor/play_iterator.py`, ansible sets a host's `_gathered_facts` property to `True` without checking to see if there are any tasks to be executed. In the event that the entire play is skipped, `_gathered_facts` will be `True` even though the `setup` module was never run. This patch modifies the logic to only set `_gathered_facts` to `True` when there are tasks to execute. Closes #15744.
Closing This TicketHi! We believe the above commit should resolve this problem for you. This will also be included in the next release. If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved. Thank you! |
with Gabriele's upcoming patches that allow the quickstart to run without performing teardown operations, we hit Ansible issue 15744 (ansible/ansible#15744), in which Ansible will incorrectly assume it has gathered facts for a host if it *skips* a play that would otherwise target that host. This commit removes `gathering=smart` from our ansible.cfg. We can restore that configuration if we pin Ansible to 2.1 or later at some point in the future. Change-Id: Idda5289a6ea4c724ad2e936b6feb1128925d0e6f
with Gabriele's upcoming patches that allow the quickstart to run without performing teardown operations, we hit Ansible issue 15744 (ansible/ansible#15744), in which Ansible will incorrectly assume it has gathered facts for a host if it *skips* a play that would otherwise target that host. This commit removes `gathering=smart` from our ansible.cfg. We can restore that configuration if we pin Ansible to 2.1 or later at some point in the future. Change-Id: Idda5289a6ea4c724ad2e936b6feb1128925d0e6f
In `lib/ansible/executor/play_iterator.py`, ansible sets a host's `_gathered_facts` property to `True` without checking to see if there are any tasks to be executed. In the event that the entire play is skipped, `_gathered_facts` will be `True` even though the `setup` module was never run. This patch modifies the logic to only set `_gathered_facts` to `True` when there are tasks to execute. Closes ansible#15744.
ISSUE TYPE
ANSIBLE VERSION
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
When
ANSIBLE_GATHERING
issmart
, a skipped play targeting aparticular host will cause Ansible to not collect facts for that host.
STEPS TO REPRODUCE
Use this playbook:
Compare:
With:
In version 2.0.0.0, you will see:
But in version 2.0.1.0 and 2.0.2.0 you will see:
That is, a play that is completely skipped and produces no output
during the
ansible-playbook
and does not run the setup modulestill results in Ansible not running
setup
in subsequent tasks.EXPECTED RESULTS
I expect Ansible to connect to the target host and gather facts at
least once during the play.
ACTUAL RESULTS
No facts are gathered.
The text was updated successfully, but these errors were encountered: