doc: update ansible.md
(#31)
* update ansible inventory静态分组用法 * Update ansible.md
This commit is contained in:
parent
816f49004f
commit
bead2f0e3b
@ -39,6 +39,30 @@ mail.example.com
|
|||||||
[webservers]
|
[webservers]
|
||||||
foo.example.com
|
foo.example.com
|
||||||
bar.example.com
|
bar.example.com
|
||||||
|
|
||||||
|
Inventory主机组使用多个IP和域名
|
||||||
|
[web]
|
||||||
|
172.18.12.5[1:4]
|
||||||
|
[webservers]
|
||||||
|
www[01:50].example.com
|
||||||
|
|
||||||
|
Inventory主机组使用子主机组
|
||||||
|
[usa:children]
|
||||||
|
southeast
|
||||||
|
northeast
|
||||||
|
southwest
|
||||||
|
northwest
|
||||||
|
|
||||||
|
给多台主机设置变量 : group variables
|
||||||
|
如果组中的所有主机共享一个变量值,则可以一次将该变量应用于整个组
|
||||||
|
[atlanta]
|
||||||
|
host1
|
||||||
|
host2
|
||||||
|
|
||||||
|
[atlanta:vars]
|
||||||
|
ntp_server=ntp.atlanta.example.com
|
||||||
|
proxy=proxy.atlanta.example.com
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 命令行(ad-hoc)
|
## 命令行(ad-hoc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user