此时可以把不同分类的机器放在不同的inventory中,达到清晰管理的目的;
配置文件:/etc/ansible/ansible.cfg
配置参数:inventory = 文件
相关inventory文件都放在/etc/ansible/inventory目录下
配置实例:
[root@shvpuppet01 inventory]# grep "^inventory" /etc/ansible/ansible.cfg inventory = /etc/ansible/inventory/all inventory = /etc/ansible/inventory/mytest inventory = /etc/ansible/inventory/product inventory = /etc/ansible/inventory/oms inventory = /etc/ansible/inventory/backserver inventory = /etc/ansible/inventory/oms_backup [root@shvpuppet01 inventory]# ls /etc/ansible/inventory/ all backserver mytest oms oms_backup product
原文地址:http://blog.51cto.com/liuzhengwei521/2097289