I am Ram. We need some help in running the Ansible playbook ( specifically how to add sudo while running playbooks ). in your environment, we can run all admin related commands with sudo acess ( by adding sudo in front of command . For example, sudo vgs or sudo vi /etc/sudoers ). We don’t have root access and hence we don’t wanted to run the playbooks with direct root access .
Most of our servers ( Redhat / Solaris / Aix ) doesn’t have root access. The possibility of running all admin activities are by running sudo as admin ( sysunx ) user.
I mean, after logging to the server with sysunx account, we run the admin related command as sudo . How to simulate this in Ansible.
I am Ram. We need some help in running the Ansible playbook ( specifically how to add sudo while running playbooks ).
in your environment, we can run all admin related commands with sudo acess ( by adding sudo in front of command . For
example, sudo vgs or sudo vi /etc/sudoers ). We don't have root access and hence we don't wanted to run the playbooks
with direct root access .
Most of our servers ( Redhat / Solaris / Aix ) doesn't have root access. The possibility of running all admin activities
are by running sudo <command> as admin ( sysunx ) user.
I mean, after logging to the server with sysunx account, we run the admin related command as sudo <command>. How to
simulate this in Ansible.
You need to add "become: yes" to the touch task (or to the whole playbook):
Ansible is designed to have all sudo (or su) access (but not remote root acess to be more specific)....So you should be sure thats is no way to have it !
If not, you can still use the same command you already use with "sudo command" with the shell module (using become: no)... but's ugly and you loose idempotence work of all the module (except shell) that are provided by ansible community
I am Ram. We need some help in running the Ansible playbook ( specifically how to add sudo while running playbooks
). in your environment, we can run all admin related commands with sudo acess ( by adding sudo in front of command .
For example, sudo vgs or sudo vi /etc/sudoers ). We don't have root access and hence we don't wanted to run the
playbooks with direct root access .
Most of our servers ( Redhat / Solaris / Aix ) doesn't have root access. The possibility of running all admin
activities are by running sudo <command> as admin ( sysunx ) user.
Hi,
Ansible is designed to have all sudo (or su) access (but not remote root acess to be more specific)....So you should be
sure thats is no way to have it !
If not, you can still use the same command you already use with "sudo command" with the shell module (using become:
no)... but's ugly and you loose idempotence work of all the module (except shell) that are provided by ansible community
I really don't see the point to promote using Ansible as glorified shell, especially as it seems that the only the sudo
password is missing in this case.