I believe it's intended that the inventory parameter always be used if set.
I'd have to go back through the vast archives to verify the logic, but in general, usually things work the way they have evolved for concrete reasons, one of those was being able to set a reasonable default but also have exceptions. OTOH, I see the reasoning of making the play stuff "beat" inventory when set as such. Thoughts everyone? On Wed, Jul 30, 2014 at 6:04 PM, Steven Ringo <goo...@stevenringo.com> wrote: > 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.stdout > > with group_vars/tag_application_csds: > > ansible_ssh_private_key_file: ~/.ssh/identity.ec2ansible_ssh_user: ubuntu > > If 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-project+unsubscr...@googlegroups.com. > To post to this group, send email to ansible-project@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 > <https://groups.google.com/d/msgid/ansible-project/41cdc084-1c0c-41c5-994c-b6c5a45c8713%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyUOzyjVvH%3Dkk5FyyAdaRnyCYth%2Bq2FR5cOqn5%2BQaWHug%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.