Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit ce8978d

Browse files
authored
fix: Address post-deploy Ansible host warnings (#335)
The post-deploy task to transfer SSH key pairs and the inventory file to any client nodes assigned the 'solution_keys' and 'solution_inventory' roles generates a prominent warning messages when the role is not present. The dynamic inventory script would only create Ansible groups for defined roles. This commit create empty 'solution_keys' and 'solution_inventory' Ansible groups in order to suppress the "[WARNING]: Could not match supplied host pattern" message.
1 parent d26bd79 commit ce8978d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/python/inventory.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ def generate_dynamic_inventory():
107107
dynamic_inventory[_role] = {'hosts': []}
108108
dynamic_inventory[_role]['hosts'].append(hostname)
109109

110+
if 'solution_keys' not in dynamic_inventory:
111+
dynamic_inventory['solution_keys'] = {'hosts': []}
112+
113+
if 'solution_inventory' not in dynamic_inventory:
114+
dynamic_inventory['solution_inventory'] = {'hosts': []}
115+
110116
return dynamic_inventory
111117

112118

0 commit comments

Comments
 (0)