一、Ansible项目目录布局
[root@a72f6ee755a7 ansible]# pwd
/etc/ansible/
[root@a72f6ee755a7 ansible]# tree -L 3
.
|-- inventories
| |-- dev
| | `-- hosts-dev
| `-- prod
| `-- hosts-prod
|-- playbooks
| |-- playbook-cdh.yml
| `-- playbook-elk.yml
`-- roles
|-- r1
| |-- README.md
| |-- defaults
| |-- files
| |-- handlers
| |-- meta
| |-- tasks
| |-- templates
| |-- tests
| `-- vars
|-- r2
| |-- README.md
| |-- defaults
| |-- files
| |-- handlers
| |-- meta
| |-- tasks
| |-- templates
| |-- tests
| `-- vars
`-- r3
|-- README.md
|-- defaults
|-- files
|-- handlers
|-- meta
|-- tasks
|-- templates
|-- tests
`-- vars
二、目录定义
三、环境变量定义及优先级
- inventories
- roles/<role name>/default/main.yml
- roles/<role name>/vars/main.yml
- playbook.yml -> vars
- command