-
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
local_action does not work properly #16059
Comments
Ok, I think I understand now what is happening: when I execute a A workaround I'm currently using is adding a condition to that task:
Or to be more complete and secure for other hosts that might now have a FQDN set:
Now I'm not sure this should still be considered a bug or it's just a side effect for how |
I think the bug here is that we're not turning local_action into a |
Well, scratch that, I believe adding run_once is what is needed here, to ensure each entry is only output once. Otherwise, it's like each inventory item is doing a |
Well this is just weird...
results in an output of:
So |
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! |
ISSUE TYPE
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Mac OS X
SUMMARY
When executing a
local_action
withwith_items
, output says it successfully executed for the first host and failed for the others - consequence is these other hosts don't continue on the rest of the play. Thelocal_action
seems to be executed just fine.STEPS TO REPRODUCE
With the gives files below, simply execute your playbook:
ansible-playbook -i hosts site.yml
EXPECTED RESULTS
I expected my
/etc/hosts
file to contain all my hosts with their respective FQDNs and the playbook to continue with the other tasks for all hosts. Not sure if I missed something about thelocal_action
directive, but from what I understand this task was not supposed to run on each of my hosts but on my local machine only.ACTUAL RESULTS
My
/etc/hosts
file was correctly edited, but Ansible complains about a missing attribute on thedict object
for all hosts besides the first one executed, so all following tasks are not executed for these failed hosts. I'm not sure thisdict object
error was supposed to happen either, because the setup task executed earlier was supposed to retrieve all facts for all hosts.The text was updated successfully, but these errors were encountered: