doc: update docs/ansible.md
(#391)
This commit is contained in:
parent
a1defb6f23
commit
9680e2a113
@ -19,19 +19,27 @@ Ansible 备忘清单
|
||||
- [Ansible 官方文档](https://docs.ansible.com)
|
||||
|
||||
### 配置位置
|
||||
<!--rehype:wrap-class=col-span-2 row-span-2-->
|
||||
|
||||
文件路径 | 说明
|
||||
:-|-
|
||||
`/etc/ansible/ansible.cfg` | 系统范围的配置
|
||||
`~/ansible.cfg` | 用户特定的配置
|
||||
`$pwd/ansible.cfg` | 当前目录下的配置
|
||||
ansible的缺省的配置文件:/etc/ansible/ansible.cfg
|
||||
ansible配置文件优先级:
|
||||
1.如果没有任何其他的ansible配置文件,默认使用/etc/ansible/ansible.cfg
|
||||
2. ~/.ansible.cfg 家目录下的.ansible.cfg
|
||||
3. ./ansible.cfg 当前目录下的ansible.cfg ,即在同一目录下ansible.cfg优先级高于.ansible.cfg
|
||||
4.环境变量 exoport ANSIBLE_CONFIG=/$DIR/ansible.cfg
|
||||
查看正在使用的ansible配置文件: ansible --version | grep "config file"
|
||||
|
||||
配置文件优先级
|
||||
|
||||
- 如果没有任何其他配置文件,默认使用 `/etc/ansible/ansible.cfg`
|
||||
- `~/.ansible.cfg` `家`目录下的 `.ansible.cfg`
|
||||
- 当前目录下的 `ansible.cfg`,即在同一目录下 `ansible.cfg` 优先级高于 `~/.ansible.cfg`
|
||||
- 环境变量 `exoport ANSIBLE_CONFIG=/$DIR/ansible.cfg`
|
||||
<!--rehype:className=style-timeline-->
|
||||
|
||||
查看正在使用的 `ansible` 配置文件:
|
||||
|
||||
```bash
|
||||
ansible --version | grep "config file"
|
||||
```
|
||||
|
||||
### Inventory文件(hosts列表)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user