change: inventory to constructed
This commit is contained in:
parent
10ec6af097
commit
e85210c1b0
@ -1,14 +1,13 @@
|
||||
env:
|
||||
children:
|
||||
env_fake:
|
||||
vars:
|
||||
ansible_host: localhost
|
||||
ansible_connection: local
|
||||
env_fake:
|
||||
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:
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
13
inventories/zz-constructed.yml
Normal file
13
inventories/zz-constructed.yml
Normal 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user