-
创建hello/hosts文件,添加如下内容
tpd ansible_ssh_host=172.28.104.225 ansible_ssh_port=22 ansible_ssh_user=frank ansible_ssh_pass=1
-
执行如下命令
ansible tpd -i hosts -m ping
返回结果
tpd | FAILED! => { "failed": true, "msg": "to use the 'ssh' connection type with passwords, you must install the sshpass program" }
-
安装sshpass
sudo apt-get install sshpass
-
执行如下命令
ansible tpd -i hosts -m ping # 返回结果 tpd | SUCCESS => { "changed": false, "failed": false, "ping": "pong" }
-
Notifications
You must be signed in to change notification settings - Fork 1
learning-ansible
License
feixiao/learning-ansible
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
learning-ansible
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published