On 08.02.17 05:10
edno...@gmail.com wrote:
> - hosts: localhost
> tasks:
> - command: whoami
> register: who_is_user1
> become: true
> become_user: user1
I think you could set a become_password at this point.
become_password: foobar
Instead of using cleartext it might be better to have this in the
host_vars (maybe encrypted with ansible-vault) and just use the
variable here:
In the file host_vars/host_foo/some.yml:
become_password_for_user_xyz: secret
And then use "become_password: {{ become_password_for_user_xyz }}" in
your playbook.
Untested.
Johannes