7. Directory Structure

7.1. Basic Project

  • provision.yaml for providers

project
├── config.yaml
├── inventory
│   ├── group_vars
│   ├── host_vars
│   └── hosts
├── provision.yaml
└── site.yaml
Listing 97. Separate provisioning from deployment and configuration tasks
$ cat site.yaml
- include: provision.yaml
- include: configure.yaml

7.2. Roles

  • Roles should be independent

  • requirements.yaml for Ansible Galaxy dependencies

project
├── config.yaml
├── provision.yaml
├── roles
│   └── requirements.yaml
└── setup.yaml

7.3. Other Directories

  • files

  • filter_plugins

  • group_vars

  • handlers

  • hosts

  • playbooks

  • roles

  • tasks

  • vars