On 20. april 2017 08:31, Павел Марченко wrote:
Good day.
I have a sudo user(user1) on the server and i need to run a task as another
unprivilleged user(user2). A dont know a password for user2 and regular way
to run something as user2 that login as user1 run "sudo -i", run "su user2"
and run something else.
And now a qestion, how can i do this in play book?

You can't stack multiple sudo/su in Ansible.

But if you can run "sudo -u user2 <command>" as user1 then you can use Ansible to make it work.

--
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/d138644c-9bcc-0a9b-16bd-0d62bcbecb96%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to