概述说明
# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first
- 这是在ansible默认配置文件说明的一段注释,从中可以了解到以下3点信息:
- 几乎全部的ansible参数都可以在ansible-playbook或者在命令行执行中重新被定义
- ANSIBLE_CONFIG 变量指向的是配置文件地址,ansible会从中去获取该文件中的参数信息
- 默认ansible的配置文件会在当前工作目录下寻找 ansible.cfg 文件,在用户主目录中.ansible.cfg隐藏文件以及全局的/etc/ansible/ansible.cfg
参数说明
- 该部分持续说明在生产系统中会经常使用到的参数进行说明。
inventory
- 主机库文件位置,hosts中存放所有主机信息
- 默认值: /etc/ansible/hosts
library
- Ansible 默认搜寻模块的位置
- 默认值:/usr/share/my_modules/
forks
- 主机通信时的默认并行进程数,默认值比较保守,可调大
- 默认值:5
sudo_user
- 提取到管理者用户
- 默认值:root
log_path
- Ansible 日志路径
- 默认值:/var/log/ansible.log