error message

190 views
Skip to first unread message

Daley Okuwa

unread,
May 25, 2017, 11:56:36 AM5/25/17
to Ansible Project, DOkuw...@yahoo.co.uk
hello when i  try to  run this command 
ansible all -i hosts -s --sudo  -m ping 

I get this error message 

192.168.85.129 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: Permission denied (publickey,password).\r\n",
    "unreachable": true

Please tell me what i am doing wrong
Normally i can ssh into this hosts 192.168.85.129
from the control server


Kai Stian Olstad

unread,
May 28, 2017, 1:31:54 PM5/28/17
to ansible...@googlegroups.com
Are you using keys or password?
If you are using password you are missing -k/--ask-pass option.

--
Kai Stian Olstad

Daley Okuwa

unread,
May 30, 2017, 3:31:03 AM5/30/17
to Ansible Project, ansible-pr...@olstad.com
thanks it worked
But also how can i use ansible without prompting me for a password 

and also another issue with ansible i am getting this error when running this adhoc command from the command line
kuwa@ubuntu:/etc/ansible$ ansible all -i hosts -u dokuwa1 --ask-pass -m yum -a "name=httpd state=present" --become-user=root --ask-become-pass
SSH password:
SUDO password[defaults to SSH password]:
192.168.85.129 | FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "python2 bindings for rpm are needed for this module. python2 yum module is needed for this  module"

Kai Stian Olstad

unread,
May 30, 2017, 6:43:29 AM5/30/17
to ansible...@googlegroups.com
On 30.05.2017 09:31, 'Daley Okuwa' via Ansible Project wrote:
> thanks it worked
> But also how can i use ansible without prompting me for a password

ansible_ssh_pass, ssh key without password, ssh key with password and
ssh-agent.
What you can use depends on you requirement since some of them has
security implication.

--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages