This commit is contained in:
DeveloperDurp 2026-02-08 06:36:31 -06:00
parent da6e152366
commit f55728cc96
2 changed files with 4 additions and 4 deletions

View file

@ -1,11 +1,11 @@
---
ansible_user: root
server_init_args: >-
{% if groups['master'] | length > 1 %}
{% if ansible_hostname == hostvars[groups['master'][0]]['ansible_hostname'] %}
{% if groups['master_group'] | length > 1 %}
{% if ansible_hostname == hostvars[groups['master_group'][0]]['ansible_hostname'] %}
--cluster-init
{% else %}
--server https://{{ hostvars[groups['master'][0]].k3s_node_ip }}:6443
--server https://{{ hostvars[groups['master_group'][0]].k3s_node_ip }}:6443
{% endif %}
--token {{ k3s_token }}
{% endif %}

View file

@ -22,7 +22,7 @@ k3s_token: "{{ lookup('env','k3s_token') }}"
k3s_node_ip: '{{ ansible_facts[flannel_iface]["ipv4"]["address"] }}'
# Disable the taint manually by setting: k3s_master_taint = false
k3s_master_taint: "{{ true if groups['node'] | default([]) | length >= 1 else false }}"
k3s_master_taint: "{{ true if groups['node_group'] | default([]) | length >= 1 else false }}"
# these arguments are recommended for servers as well as agents:
extra_args: >-