首页 > 其他 > 详细

ansible配置多个inventory

时间:2018-04-12 11:24:21      阅读:267      评论:0      收藏:0      [点我收藏+]
在工作中的机器往往有上百上千台,在这些机器中功能往往是各不同相的,把这些机器都放在/etc/ansible/hosts中时间久了往往会混乱;

此时可以把不同分类的机器放在不同的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

 


ansible配置多个inventory

原文:http://blog.51cto.com/liuzhengwei521/2097289

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!