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