I’m trying to run ad-hoc command and use privilege access to run the command here is what I try to running :
ansible localhost -m service -a "name=httpd state=started" -b -k
After I enter my SSH password I get bellow message:
SSH password:
127.0.0.1 | FAILED! => {
"msg": "Missing sudo password"
}
any one have had this issue before?
You need to add “-K” for asking the become password. It will re-use the ssh password if you leave it blank, but it is a required flag if a password is required for your become method.
1 Like
Thanks , It is working now , I thought is small “k”
bcoca
(Brian Coca)
March 25, 2024, 7:32pm
4
ansible --help
extract:
-K, --ask-become-pass ask for privilege escalation password
-k, --ask-pass ask for connection password
2 Likes
system
(system)
Closed
April 24, 2024, 7:33pm
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.