Ansible Inventory
批量管理主机的时候, 需要预先定义主机或者组, 这个文件叫 Inventory, 默认位于 /etc/ansible/hosts.
/etc/ansible/hosts 文件的格式如下:
mail.example.com
[web]
web[1:5].example.com
[db]
db[1:3].example.com
[prod:children]
web
db
批量管理主机的时候, 需要预先定义主机或者组, 这个文件叫 Inventory, 默认位于 /etc/ansible/hosts.
/etc/ansible/hosts 文件的格式如下:
mail.example.com
[web]
web[1:5].example.com
[db]
db[1:3].example.com
[prod:children]
web
db