-
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
Unexpected failure during module execution: 'ansible_job_id'
when using multiple facts modules on Windows on ansible-core 2.16.0 and later
#83219
Comments
Unexpected failure during module execution: 'ansible_job_id'
when using multiple facts modules on Windows on ansible-core 2.16.0 and laterUnexpected failure during module execution: 'ansible_job_id'
when using multiple facts modules on Windows on ansible-core 2.16.0 and later
Files identified in the description: If these files are incorrect, please update the |
cc @jborean93 |
may i know if windows11 also hit the same error ? |
Thanks for the bug report and detailed reproducer. The problem here stems from the change made in #80597 that made A workaround this issue is to explicitly disable parallel gathering to go back to the old behaviour by setting |
I've opened #83275 which should solve this problem. Will need to talk internally around the best way to backport this change as currently it relies on new features being added which we don't backport. |
@kirkzhangtech Given jborean's explanation, it seems to be related specifically to PowerShell rather than to Windows itself, so I expect the results would be the same with a Windows 11 machine. I haven't yet found a way to use non-PowerShell modules on Windows (the ansiballz framework seems to fall over when a Windows machine is the target). But I suppose such a thing would circumvent this bug just as well if it could be made to work on Windows 10 or 11. |
You're welcome!
Ahh, I see. Thanks for the explanation and workaround! It does appear to work. And, just in case anyone else stumbles across this report and has the same question I did, explicit calls to the ansible.builtin.gather_facts module appear to respect
But, given that |
it is intended, i'll make sure to update docs |
Great, thank you! |
Summary
Hello!
When I configure a Windows machine to use multiple
ansible_facts_modules
, I getUnexpected failure during module execution: 'ansible_job_id'
during the gathering facts stage of any playbook. This error didn't previously occur (in Ansible 2.14) with the same configuration, but occurs now in 2.16.Issue Type
Bug Report
Component Name
gather_facts
Ansible Version
Configuration
OS / Environment
The control node has Rocky 8. Failing hosts have Windows 10.
Steps to Reproduce
The error seems to have been introduced in ansible-core 2.16.0. I have tested the following versions of ansible-core for the error:
The following
ansible_
variables are set via inventory on the affected Windows machines. I don't expect them to be relevant, but I'm including them in case they are:Beyond that, perhaps the simplest way to reproduce the error is to create a simple custom facts module:
win_helloworld_facts.ps1
...then configure a Windows machine to use both that module and
smart
(although you'd get the same result with 2 custom facts modules instead):group_vars/windows.yml
, or however you see fit to introduce this variable:...then run a basic do-nothing playbook with fact gathering enabled:
test.yml
ansible-playbook --limit some-windows-machine test.yml
Expected Results
I expect the playbook to run through and print "Hello World!"
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: