Skip to content

Commit

Permalink
doc: update docs/ansible.md (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 7, 2023
1 parent a1defb6 commit 9680e2a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions docs/ansible.md
Original file line number Diff line number Diff line change
Expand Up @@ -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列表)

Expand Down

0 comments on commit 9680e2a

Please sign in to comment.