Hello there,
As a user “vamsi”,i am trying to install httpd on node1 machine using ad-hoc command “yum” from the command line.
please note that user vamsi has sudo privileges on node1.
I tried everything (–become,–ask-become-pass,–become-user) and nothing works.It always gives me the error- You need to be root to perform this command.Below is my code.
[vamsi@controller playbooks]$ ansible node1 -m yum -a “name=httpd state=present” -u vamsi --ask-become-pass
SUDO password:
node1 | FAILED! => {
“changed”: false,
“msg”: “You need to be root to perform this command.\n”,
“rc”: 1,
“results”: [
“Loaded plugins: fastestmirror, langpacks\n”
]
}
Appreciate your help,please.
Thanks,
Vamsi