change: inventory to constructed

This commit is contained in:
rcordier 2024-05-22 15:22:38 -04:00
parent 10ec6af097
commit e85210c1b0
4 changed files with 36 additions and 31 deletions

View File

@ -1,14 +1,13 @@
env:
children:
env_fake:
vars:
ansible_host: localhost
ansible_connection: local
hosts:
local:
fake-client1-web1:
fake-client1-web2:
fake-client1-db:
vars:
ansible_host: localhost
ansible_connection: local
environment_name2: fake5
roles:
children:
@ -16,8 +15,8 @@ roles:
hosts:
fake-client1-web1:
fake-client1-web2:
vars:
ansible_user: root
#vars:
# ansible_user: root
role_db:
hosts:
fake-client1-db:

View File

@ -2,16 +2,12 @@
env_lab:
hosts:
rocky-1:
ansible_host: 192.168.122.129
#ansible_host: 192.168.122.129
rocky-2:
ansible_host: 192.168.122.19
#ansible_host: 192.168.122.19
vars:
ansible_user: cloud-user
# Inject environment
env:
children:
env_lab:
environment_name2: lab5
# Inject roles
roles:
@ -22,6 +18,3 @@ roles:
role_db:
hosts:
rocky-2:
vars:
environment_name: lab

View File

@ -0,0 +1,13 @@
# inventory.config file in YAML format
# Documentation: ansible-doc -t inventory ansible.builtin.constructed
#
# Reproduce AWX behavior for constructed inventories
plugin: ansible.builtin.constructed
strict: False
keyed_groups:
- prefix: env_
key: environment_name
parent_group: env