-
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
add_host followed by local_action adds 127.0.0.1 to inventory in following plays #12694
Comments
HI @c0rner, I just tested this on devel and it does not occur: # ansible-playbook -vv test.yml -i 192.168.122.100, Using /etc/ansible/ansible.cfg as config file 2 plays in test.yml PLAY *************************************************************************** TASK [add_host group=new name={{ inventory_hostname }}] ************************ changed: [192.168.122.100] => {"add_host": {"groups": ["new"], "host_name": "192.168.122.100", "host_vars": {"group": "new"}}, "changed": true} TASK [ping] ******************************************************************** ok: [192.168.122.100] => {"changed": false, "ping": "pong"} TASK [ping] ******************************************************************** ok: [192.168.122.100] => {"changed": false, "ping": "pong"} PLAY *************************************************************************** TASK [ping] ******************************************************************** ok: [192.168.122.100] => {"changed": false, "ping": "pong"} PLAY RECAP ********************************************************************* 192.168.122.100 : ok=4 changed=1 unreachable=0 failed=0 I verified (after noticing in the above output) that the Normally we close bugs once they're verified as fixed on devel, however we'll hold this open for now to see if it's something we want to backport/fix in the 1.9.x branch. Thanks! |
Encountering the same problem here, on Ansible 1.9.4. |
@mgarstecki Yes, unfortunately the fix in devel is due to the rewrite there, and I don't believe there's anything we can backport to he 1.9.x branch, so this will only be fixed going forward for now. |
We took another look at this in preparation for 1.9.5 and decided that this is an issue which has a high risk of regression if we try to fix it in 1.9 (due to not having an easy way to fix it in the 1.9 codebase and the code in 2.0 being very different). So this is one where we're going to have to say please upgrade to 2.x if this is an issue that you need to have fixed. |
Issue Type:
Ansible Version:
1.9.3 from pypi
Ansible Configuration:
Using default configuration
Environment:
Mac OS X 10.10.5
Summary:
I've actively been using a role to add host to new dynamic groups for a while and it has been working fine until today when I added a
local_ action
to the play. Now all following plays have a new host '127.0.0.1' in their inventory.Steps To Reproduce:
I reduced it to being something with
add_host
andlocal_action
and made a small playbook without roles to reproduce the issue.Expected Results:
Host 127.0.0.1 should not be added to inventory of chained plays.
Actual Results:
Host 127.0.0.1 is added to inventory list.
Output from playbook
The text was updated successfully, but these errors were encountered: