英文:
Why ansible is not able to ping for locally?
问题
问题:
我有一个EC2实例,其IP地址是"52.15.160.250"。我在其中安装了Ansible。在主机清单文件[/etc/ansible/hosts]中,我使用了以下配置:
[localhost]
52.15.160.250
然后,我尝试对本地主机执行ping操作:
ansible -m ping all
或者
ansible -m ping 52.15.160.250
但我得到了以下错误:
英文:
Without writing ansible-playbook Why ansible is not able to ping locally ?
Problem:-
I have taken 1 ec2 instance and the IP of ec2 is "52.15.160.250". I installed ansible in it. Inside the inventory file [/etc/ansible/hosts] i have taken
> [localhost]
>
> 52.15.160.250
Then visudo description
I tried to ping local host
> ansible -m ping all
or
> ansible -m ping 52.15.160.250
I am getting the following error
答案1
得分: 1
尝试添加如下:
[localhost]
52.15.160.250 ansible_connection=local
这样,它不会尝试通过SSH连接,而会使用本地连接。
英文:
try adding like this:
[localhost]
52.15.160.250 ansible_connection=local
this way, it would not attempt over ssh rather it would go by local connection.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论