Skip to content

Instantly share code, notes, and snippets.

@jgornick
Forked from jdauphant/gist:10023858
Last active March 18, 2017 11:07
Show Gist options
  • Save jgornick/10059024 to your computer and use it in GitHub Desktop.
Save jgornick/10059024 to your computer and use it in GitHub Desktop.
Ansible: Directory Structure
production/
ansible_hosts # inventory file for production servers
group_vars/
group1 # here we assign variables to particular groups for production
group2 # ""
host_vars/
hostname1 # if production systems need specific variables, put them here
hostname2 # ""
files/
staging/
ansible_hosts # inventory file for stage environment
group_vars/
host_vars/
files/
group_vars/
group1 # here we assign variables to particular groups
group2 # ""
host_vars/
hostname1 # if systems need specific variables, put them here
hostname2 # ""
files/
file1
site.yml # master playbook
webservers.yml # playbook for webserver tier
dbservers.yml # playbook for dbserver tier
roles/
ansible-playbook -i production/ansible_hosts site.yml
ansible-playbook -i staging/ansible_hosts site.yml
@h4rdeep
Copy link

h4rdeep commented Mar 18, 2017

Hi,

How you define ansible config file for this file structure and host files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment