Skip to content

Commit

Permalink
allow role overrides for VMs in standard clusters
Browse files Browse the repository at this point in the history
adding role=master or role=worker to an hv_vm inventory definition
will assign that node to they specified role when the siteconfig is
built
  • Loading branch information
radez authored and akrzos committed Oct 9, 2024
1 parent 0b35489 commit b6cd219
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ spec:
# "{{ (((item - 1) * standard_cluster_node_count) + offset) }} until {{ ((item * standard_cluster_node_count) - 1 + offset) }}"
{% for vm in range(((item - 1) * standard_cluster_node_count) + offset, (item * standard_cluster_node_count) + offset, 1) %}
- hostName: "{{ groups['hv_vm'][vm] }}"
{% if vm < (((item - 1) * standard_cluster_node_count) + offset + 3) %}
{% if 'role' in hostvars[groups['hv_vm'][vm]] %}
role: "{{ hostvars[groups['hv_vm'][vm]]['role'] }}"
{% elif vm < (((item - 1) * standard_cluster_node_count) + offset + 3) %}
role: "master"
{% else %}
role: "worker"
Expand Down

0 comments on commit b6cd219

Please sign in to comment.