change: inventory to the best practices

This commit is contained in:
rcordier 2024-05-22 13:18:44 -04:00
parent 18b363ee3b
commit 2486634762
3 changed files with 35 additions and 22 deletions

7
inventories/common.yml Normal file
View File

@ -0,0 +1,7 @@
all:
children:
env:
roles:
children:
role_web:
role_db:

View File

@ -1,20 +1,24 @@
env_fake:
env:
children:
env_fake:
vars:
ansible_host: localhost
ansible_connection: local
hosts:
local:
fake-client1-web1:
fake-client1-web2:
fake-client1-db:
roles:
children:
web:
role_web:
hosts:
fake-client1-web1:
#ansible_port: 2222
fake-client1-web2:
vars:
ansible_user: root
db:
role_db:
hosts:
fake-client1-db:
#vars:

View File

@ -1,5 +1,7 @@
---
env_lab:
env:
children:
env_lab:
hosts:
rocky-1:
ansible_host: 192.168.122.129
@ -7,12 +9,12 @@ env_lab:
ansible_host: 192.168.122.19
vars:
ansible_user: cloud-user
all:
roles:
children:
web:
role_web:
hosts:
rocky-1:
db:
role_db:
hosts:
rocky-2:
vars: