Hi
In the host_var file for the server I have ansible_user set like this.
$ cat host_vars/u1.yml
---
ansible_user: ansible
Sometimes I would like to use an another user for some ad hoc commands,
but -u/--user is ignored
$ ansible u1 -a id -vvvv -u user1
Loaded callback minimal of type stdout, v2.0
<192.168.122.106> ESTABLISH SSH CONNECTION FOR USER: ansible
Shouldn’t -u/--user overwrite ansible_user variable?
Or is -e/--extra-vars the only way?
$ ansible u1 -a id -vvvv -e ansible_user=user1
Loaded callback minimal of type stdout, v2.0
<192.168.122.106> ESTABLISH SSH CONNECTION FOR USER: user1
--
Kai Stian Olstad
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/bd8883e852abab2e9494c687aa068ea3%40olstad.com.
For more options, visit https://groups.google.com/d/optout.