从基本的,主机目录文件“inventory”,extra module纺织路径"library",远程主机的临时文件位置"remote_tmp",管理节点上临时文件的位置"local_tmp"

inventory = /etc/ansible/hosts
library = /usr/share/my_modules/
remote_tmp = $HOME/.ansible/tmp
local_tmp = $HOME/.ansible/tmp

到高级的,连接端口号"accelerate_port",超时时间等。

accelerate_port = 5099
accelerate_timeout = 30
accelerate_connect_timeout = 5.0

看一个完整的anbile配置文件例子,就能基本了解到ansible都能配置什麽了:

https://raw.githubusercontent.com/ansible/ansible/devel/examples/ansible.cfg

对ansible配置文件里面的关键字不能完整理解,还可以参考关键词解释列表:

http://docs.ansible.com/ansible/intro_configuration.html#explanation-of-values-by-section

二、ansbile配置文件的优先级

ansible的默认配置文件是/etc/ansible/ansible.cfg。其实ansible会照顾下面的顺序查找配置文件,并使用第一个发现的配置文件。

* ANSIBLE_CONFIG (an environment variable)
* ansible.cfg (in the current directory)
* .ansible.cfg (in the home directory)
* /etc/ansible/ansible.cfg

Ansible1.5 以前的版本顺序为:

* ansible.cfg (in the current directory)
* ANSIBLE_CONFIG (an environment variable)
* .ansible.cfg (in the home directory)
* /etc/ansible/ansible.cfg

相关文章:

  • 2022-01-29
  • 2022-12-23
  • 2021-08-19
  • 2021-10-03
  • 2021-11-05
  • 2021-10-31
  • 2021-07-07
猜你喜欢
  • 2021-11-22
  • 2021-08-08
  • 2021-07-11
  • 2021-10-20
  • 2021-06-17
  • 2022-12-23
  • 2021-06-16
相关资源
相似解决方案