首页 > 其他 > 详细

ansible 主机清单 /etc/ansible/hosts

时间:2019-03-17 16:52:15      阅读:562      评论:0      收藏:0      [点我收藏+]



主机清单 [webservers] ansible01 ansible02 ansible03 ansible04

  

 

[root@ftp:/root]
> ansible webservers -u root -k -m ping -o 
SSH password: 
ansible03 | SUCCESS => {"changed": false, "ping": "pong"}
ansible01 | SUCCESS => {"changed": false, "ping": "pong"}
ansible02 | SUCCESS => {"changed": false, "ping": "pong"}
ansible04 | SUCCESS => {"changed": false, "ping": "pong"}

[root@ftp:/root]
>

 

Ansible Inventory 内置参数

 

技术分享图片

 

 

技术分享图片

 

技术分享图片

 

 

[root@ftp:/root]
> ansible webservers -m ping -o 
ansible01 | SUCCESS => {"changed": false, "ping": "pong"}
ansible04 | SUCCESS => {"changed": false, "ping": "pong"}
ansible03 | SUCCESS => {"changed": false, "ping": "pong"}
ansible02 | SUCCESS => {"changed": false, "ping": "pong"}






[webservers]

ansible01 ansible_ssh_port=‘22‘

ansible[02:04] 

[webservers:vars]
ansible_ssh_user=‘root‘ 
ansible_ssh_pass=‘AAbb0101‘

  

 

ansible 主机清单 /etc/ansible/hosts

原文:https://www.cnblogs.com/liweiming/p/10547539.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!