Assign hosts to service/component groups
This commit is contained in:
parent
398409e054
commit
06be633265
1 changed files with 24 additions and 0 deletions
24
inventory/06-hosts-in-service-groups.yml
Normal file
24
inventory/06-hosts-in-service-groups.yml
Normal file
|
@ -0,0 +1,24 @@
|
|||
plugin: constructed
|
||||
strict: false
|
||||
|
||||
compose:
|
||||
|
||||
# Service instance groups
|
||||
_inv__instance_group: >-
|
||||
inv__service ~ '_' ~ inv__instance ~ _inv__managed
|
||||
|
||||
# Service component groups
|
||||
_inv__component_group: >-
|
||||
inv__service ~ '_' ~ inv__subcomponent | default( inv__component )
|
||||
~ _inv__managed
|
||||
|
||||
keyed_groups:
|
||||
|
||||
# Create service instance groups inside the main service group.
|
||||
- prefix: svin
|
||||
key: _inv__instance_group
|
||||
parent_group: "svc_{{ inv__service }}"
|
||||
|
||||
# Add the host to the component group
|
||||
- prefix: svcm
|
||||
key: _inv__component_group
|
Loading…
Reference in a new issue