-
Notifications
You must be signed in to change notification settings - Fork 24k
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
delegate_to: localhost tries to SSH into localhost and Fails #31420
Comments
This indicates that you have If you omit If you have further questions please stop by IRC or the mailing list:
|
@sivel I can confirm that localhost is **not ** listed in the inventory.
|
the other option is that you have |
@bcoca |
@fia5000 because before 2.4 there was 'bug' (considering it now feature?) in which the implicit localhost did NOT get vars from 'all'. |
thinking of making this a 'toggle' and defaulting to the previous behaviour |
tested with PR above (default value is false),
localhost w/o all
bc |
back to previous implicit localhost behaviour fixes #31420
@bcoca We always use implicit localhost, with a bunch of variables defined in inventory group_vars/all.yml (mostly related to cloud orchestration). The variables get picked up just fine when running playbooks with I mean it is not a big hassle to add the explicit localhost, but such behavior change in a x.y.z release seems to be in line with the recent /r/ansible rants? |
back to previous implicit localhost behaviour fixes ansible#31420
this was misdiagnosed ... having connection vars in 'all' should not affect implicit localhost, which always loaded the 'all' group vars. reverting the PR, reopening this for reexamination |
@fia5000, my tests were flawed as they were for vars that were not also defined by the implicit localhost, which defines 2 vars: So whatever is overriding your settings is coming from somewhere else (vars/extravars?), can you check for other spots in which ansible_connection gets set? @sayap we don't normally see comments in closed tickets, a better way to let us know there is a problem with a fix is either a new ticket or contacting us via ML/IRC. |
@bcoca This is one of the inventory files:
Once I got rid of the |
ah, failure of my testing, it happens with 'all' from inventory, but not from group_vars/all, fixing |
they already get added in vars manager on use. fixes ansible#31420
they already get added in vars manager on use. fixes #31420
ISSUE TYPE
COMPONENT NAME
delegate_to
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
SUMMARY
The
delegate_to
option is broken in Ansible 2.4.1.0 if the task is being delegated tolocalhost
(Ansible Master), Ansible tries to explicitly ssh to the localhost. When I downgraded from 2.4.1.0 to 2.3.3.0, delegate_to works correctly with localhost; as in ansible uses the local python environment to execute commands instead of trying to ssh to localhostSTEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: