August 2017
Intermediate to advanced
332 pages
9h 16m
English
In their simplest form, we can have two environments: staging and production, each having one Docker host machine. In real life, we may want to add more host groups for each environment if we want to have servers in different locations or having different requirements.
Let's create two Ansible inventory files. Starting from the staging, we can define the inventory/staging file. Assuming the staging address is 192.168.0.241, it would have the following content:
[webservers]web1 ansible_host=192.168.0.241 ansible_user=admin
By analogy, if the production IP address is 192.168.0.242, then the inventory/production should look like this:
[webservers]web2 ansible_host=192.168.0.242 ansible_user=admin
Read now
Unlock full access