Commit 10006f58 by Paul

blog: clearify directory tree structure

parent 29f19800
Pipeline #7101574 passed with stage
in 3 minutes 49 seconds
......@@ -25,11 +25,11 @@ Don't worry dynamic inventories are easy to manipulate in Ansible. Just add an e
So as I said, I really advise you to **separate your different environments into different "inventory directory"**:
~~~ yaml
integ/
hosts # ← inventory file containing integration servers
prod/
hosts # ← inventory file containing production servers
├── integ/
│ └── hosts # ← inventory file containing integration servers
├── prod/
│ └── hosts # ← inventory file containing production servers
~~~
You will then be sure to never mix **integration** hosts into your **production** inventory. Also it will be easy for you to factorize some variables that are environment agnostic.
......@@ -37,25 +37,25 @@ You will then be sure to never mix **integration** hosts into your **production*
Imagine you have a `webserver` **group**. This _group_ notion has nothing _environment_ related: it is a group that exists for all of your environments. You will thus be able to store variables in your directory structure like this:
~~~ yaml
integ/
host_vars/ # ← Host specific variables
group_vars/
webserver/
vars.yml # ← Integration env specific variables
hosts # Integration inventory
prod/
host_vars/ # ← Host specific variables
group_vars/
webserver/
vars.yml # ← Production env specific variables
hosts # Production inventory
group_vars/
webserver/
vars.yml # ← Variables common to all envs
├── integ/
│ ├── host_vars/ # ← Host specific variables
│ │
│ ├── group_vars/
│ │ └── webserver/
│ │ └── vars.yml # ← Integration env specific variables
│ └── hosts # Integration inventory
├── prod/
│ ├── host_vars/ # ← Host specific variables
│ │
│ ├── group_vars/
│ │ └── webserver/
│ │ └── vars.yml # ← Production env specific variables
│ └── hosts # Production inventory
├── group_vars/
│ └── webserver/
│ └── vars.yml # ← Variables common to all envs
~~~
The set of all those variables files will be your **infrastructure's configuration data**.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment