On 21.05.2018 17:51, Kannappan M wrote:
When i try to shutdown the connected node using ansible am
getting
the below error kindly assist
128 ansible iaf -m shell "/usr/sbin/shutdown -h now" -b
129 ansible iaf -m shell "/usr/sbin/shutdown -h now" --become
130 ansible iaf -m shell '/usr/sbin/shutdown -h now' --become
None of these are valid, they are missing -a, and Ansible should write
an error message.
154 ansible iaf -a "/usr/sbin/shutdown -h now" --become
This one has the correct syntax.
155 ansible iaf -a "sudo /usr/sbin/shutdown -h now"
This should work, but I would recommend the previous one.
for the 155 command am getting message as user is not in the
sudoers list
but i have already made an entry in sudoers file and also
added
to wheel group
cat /etc/group |grep wheel
wheel:x:10:tester
tester ALL=NOPASSWD: ALL
Does sudo work when you login manually and test?
Are you sure you are using the user tester in Ansible?
And you need to run ansible with -vvvv to get some more verbose output
about what is happing.
--
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/973a1ec9baf8c00359a72ea62db54639%40olstad.com.
For more options, visit https://groups.google.com/d/optout.