Skip to content

Commit

Permalink
fix generated inventory files without a database inventory group (#251)
Browse files Browse the repository at this point in the history
Without the control on the existence of the groups in the inventory file, not having a database section in the inventory generates a malformed inventory file.
  • Loading branch information
AdilMetkali authored Aug 5, 2024
1 parent 2b9b273 commit 8363732
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions roles/aap_setup_prepare/templates/inventory.j2
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{# output all the hosts and their groups #}

{% for group_key in aap_setup_prep_inv_nodes %}

{%if group_key in groups %}
[{{ group_key }}]
{% for node_key in aap_setup_prep_inv_nodes[group_key] %}
{{ node_key }}{% if aap_setup_prep_inv_nodes[group_key][node_key] is defined %} {{ aap_setup_prep_inv_nodes[group_key][node_key] }}{% endif %}

{% endfor %}

{% endif %}

{% endfor %}

{# output all the variables and their groups #}
Expand Down

0 comments on commit 8363732

Please sign in to comment.