Tuesday, July 28, 2015

SUDO LDAP USER - Run Remote Command

ansible -i hosts servers-group-1 -m command -a "tail /var/log/syslog" -k -u gbhujanga -s -K
-k = --ask-password
-K = --ask-sudo-pass
-s = --sudo
[servers-group-1]
test-server.prod.walmart.com ansible_ssh_pass=root123 ansible_sudo_pass=root123

If ansible_ssh_pass & ansible_sudo_pass is mentioned in hosts files,then no need to mention -k and -K for ansible command.

No comments :

Post a Comment