标签:alt highlight www out style span ash some 定义变量
Inventory的管理便是服务器的管理。
[root@zydev01 ~]# ansible all --list-hosts hosts (3): 192.168.1.105 120.77.85.77 192.168.1.101
加上children的方式声明组中包含其它组
[atlanta] host1 host2 [raleigh] host2 host3 [southeast:children] atlanta raleigh [southeast:vars] #定义组的主机的参数
ansible_port=3235 some_server=foo.southeast.example.com halon_system_timeout=30 self_destruct_countdown=60 escape_pods=2
mysql_port=3307 [usa:children] southeast northeast
Inventory的参数分为行为参数(ansible默认的,如ansible_port)和自定义变量(mysql_port)
打印参数:
定义组
[webservers] www[01:50].example.com
[databases]
db-[a:f].example.com
匹配组
ansible web* -m ping
标签:alt highlight www out style span ash some 定义变量
原文地址:http://www.cnblogs.com/zydev/p/7788667.html