Hi, all.
I want to add current user to sudo and adm group, so I write follow task:
````yaml
- name: set current user to sudo and adm group
user: >
name={{ ansible_ssh_user }} groups=sudo,adm shell=/bin/bash
append=yes
````
It works in ansible 1.9, but in 2.0.0-0.7.rc2, I can't get
ansible_ssh_user, I use this command to test this:
ansible -i hosts log0 -m debug -a 'msg={{ansible_ssh_user}}'
*How can I get current user in task?*
PS: ansible_ssh_user and ansible_user cannot work.
--
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/03247b47-55e7-4a86-bf44-9155c5616c88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.