Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
Shouldn’t --user on command line overwrite ansible_user?
10 views
Skip to first unread message
Kai Stian Olstad
unread,
Mar 3, 2017, 3:17:32 AM
3/3/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages