Is it possible to use the su and sudo at the task?

23 views
Skip to first unread message

明智那央

unread,
Jul 15, 2016, 10:31:02 PM7/15/16
to Ansible Project
Hi,

I'm trying to use Ansible in my production.

I'd like to do the following command in Ansible.
Is it possible?

$ ssh user_a@xxx
$ su user_b
$ sudo xxx

In my production,
user_a is only user allowed to SSH connection.
And user_b is only user allowed to become sudo.

In this situation, is there any good idea?

Brian Coca

unread,
Sep 9, 2016, 2:24:21 PM9/9/16
to ansible...@googlegroups.com
You cannot chain privilege escalation methods within Ansible, you CAN use `become + shell: su ....`
Reply all
Reply to author
Forward
0 new messages