Hi,
I seem to be having issues when remote_user is used in conjunction with ansible_ssh_user
For this playbook:
- hosts: tag_application_csds
tasks:
- command: "whoami"
remote_user: deploy
register: whoami
- debug: var=whoami.stdoutwith group_vars/tag_application_csds:
ansible_ssh_private_key_file: ~/.ssh/identity.ec2
ansible_ssh_user: ubuntuIf I run $ ansible-playbook test.yml (no other arguments), I get:
ok: [1.1.1.1] => {
"whoami.stdout": "ubuntu"
}This despite the remote_user: deploy parameter on the task.
If delete the ansible_ssh_user parameter from the group_vars file and run $ ansible-playbook test.yml -u ubuntu, I get as expected:
ok: [1.1.1.1] => {
"whoami.stdout": "deploy"
}It seems like ansible_ssh_user overrides remote_user used in the playbook.
Is this desired behaviour? If so, it seems counterintuitive to me. If its a bug then I will lodge it.
On different, but related note, are there any benefits/differences in playbook behaviour when using remote_user than using sudo_user? Seems that for remote_user to work, the user must have credentials that allow it to be logged in from the terminal.
Thanks so much,
Steve
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/41cdc084-1c0c-41c5-994c-b6c5a45c8713%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
OTOH, I see the reasoning of making the play stuff "beat" inventory when set as such.
it makes sense that the inventory variables override others, the specifics of a host should override the generalities of the plays.If a play has remote_user = user1, but some hosts have different users, you would not be able to use them otherwise, with inventory overriding, this is possible.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CADn%2BHsxTcg1oyUog3jSDSHBrtuZRBoW5Bdwfc0zVLwR9Y%3Du6bw%40mail.gmail.com.