[root@m01 ~]# vim /etc/ansible/ansible.cfg # 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
[root@m01 ~]# rpm -ql ansible
[root@m01 ~]# zcat /usr/share/man/man1/ansible-config.1.gz#要查看完整列表,请访问https://docs.ansibe.com/或使用ansibe-config命令。
For a full list check \fI\%https://docs.ansible.com/\fP\&. or use the \fIansible\-config\fP command.
#/etc/ansible/ansible.cfg 配置文件,如果存在则使用
/etc/ansible/ansible.cfg \-\- Config file, used if present
#~/.ansible.cfg 用户配置文件,覆盖默认配置(如果存在)
~/.ansible.cfg \-\- User config file, overrides the default config if present
#\&/ansible.cfg 本地配置文件(在当前工作目录中)假定为(aqproject-specific)(aq,如果存在,则重写其余文件)。
\&./ansible.cfg \-\- Local config file (in current working directory) assumed to be \(aqproject specific\(aq and overrides the rest if present.
#如上所述,ANSIBLE_CONFIG环境变量将覆盖所有其他环境变量。
As mentioned above, the ANSIBLE_CONFIG environment variable will override all others.
#生效优先级
ANSIBLE_CONFIG >> $ANSIBLE_CONFIG/ansible.cfg >> ~/.ansible.cfg >> /etc/ansible/ansible.cfg
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库