control:168.100.100.108
web:168.100.100.109
1.主机连通性测试
配置 /etc/ansilbe/host
#web.ansible.com
168.100.100.109
[webserver]
#web.ansible.com
168.100.100.109
ansible 168.100.100.109 -m ping //-m 使用何种模块管理操作
ansible webserver -m ping
2.再服务器上显示 “hello ansible”
在home目录下创建资源清单文件 inventory.cfg
vim /home/inventory.cfg
[webserver]
168.100.100.109
ansible webserver -m shell -a '/bin/echo hello ansible' -i inventory.cfg