ansible学习笔记

2019-03-25  本文已影响0人  烤玉米馒头

inventory配置

主机变量
[atlanta]
# http_port、maxRequestsPerChild都是变量,可以在paybook中使用
host1 http_port=80 maxRequestsPerChild=808
host2 http_port=303 maxRequestsPerChild=909
组变量
[atlanta]
host1
host2

#[组名:vars],给整组设置变量
[atlanta:vars]
ntp_server=ntp.atlanta.example.com
proxy=proxy.atlanta.example.com
把一个组作为另一个组的子成员
[atlanta]
host1
host2

[raleigh]
host2
host3
#[组名:children],使用children属性,southeast的成员只能为其他组名
[southeast:children] 
atlanta
raleigh
上一篇 下一篇

猜你喜欢

热点阅读