mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-25 10:12:38 +01:00
Replace hardcoded 'master' group name with 'group_name_master' variable (#337)
For improved flexibility and maintainability. * Update tasks in node role to use 'group_name_master' variable instead of hardcoded 'master' group name * Update tasks in master role to use 'group_name_master' variable instead of hardcoded 'master' group name * Update tasks in post role to use 'group_name_master' variable instead of hardcoded 'master' group name Signed-off-by: Christian Berendt <berendt@23technologies.cloud>
This commit is contained in:
committed by
GitHub
parent
bd44a9b126
commit
215690b55b
@@ -4,12 +4,16 @@
|
||||
# will determine the right interface automatically at runtime.
|
||||
kube_vip_iface: null
|
||||
|
||||
# Name of the master group
|
||||
group_name_master: master
|
||||
|
||||
# yamllint disable rule:line-length
|
||||
server_init_args: >-
|
||||
{% if groups['master'] | length > 1 %}
|
||||
{% if ansible_hostname == hostvars[groups['master'][0]]['ansible_hostname'] %}
|
||||
{% if groups[group_name_master | default('master')] | length > 1 %}
|
||||
{% if ansible_hostname == hostvars[groups[group_name_master | default('master')][0]]['ansible_hostname'] %}
|
||||
--cluster-init
|
||||
{% else %}
|
||||
--server https://{{ hostvars[groups['master'][0]].k3s_node_ip | split(",") | first | ansible.utils.ipwrap }}:6443
|
||||
--server https://{{ hostvars[groups[group_name_master | default('master')][0]].k3s_node_ip | split(",") | first | ansible.utils.ipwrap }}:6443
|
||||
{% endif %}
|
||||
--token {{ k3s_token }}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user