Ansible最佳实践和ansible.cfg

时间:2017-06-23 13:01:58

标签: ansible

我正在阅读有关ansible的alternative diretory layout来组织我的剧本,角色和其他所有内容,但我不知道如何配置ansible.cfg以便能够使用它。

ansible如何在$ANSIBLE_HOME/inventories/production/hosts.yml这样的目录布局中找出我的库存的位置,而不像前面提到的链接中的示例那样通过-i的完整路径?

考虑将存储我的剧本的$ANSIBLE_HOME

1 个答案:

答案 0 :(得分:1)

对于ansible.cfg,有一个记录参数inventory

  

这是Ansible将用于确定可与之交谈的主机的库存文件,脚本或目录的默认位置:

inventory = /etc/ansible/hosts
相关问题