Merge branch 'main' of github.com:PyratLabs/ansible-role-k3s into main

This commit is contained in:
Xan Manning 2021-08-14 14:18:39 +01:00
commit 1780b5a20f

View File

@ -102,6 +102,15 @@
check_mode: false check_mode: false
when: k3s_control_node_address is defined when: k3s_control_node_address is defined
- name: Ensure the node registration address is defined from node-ip
ansible.builtin.set_fact:
k3s_registration_address: "{{ hostvars[k3s_control_delegate].k3s_runtime_config['node-ip'] }}"
check_mode: false
when:
- k3s_registration_address is not defined
- k3s_control_node_address is not defined
- hostvars[k3s_control_delegate].k3s_runtime_config['node-ip'] is defined
- name: Ensure the node registration address is defined - name: Ensure the node registration address is defined
ansible.builtin.set_fact: ansible.builtin.set_fact:
k3s_registration_address: "{{ hostvars[k3s_control_delegate].ansible_host | default(hostvars[k3s_control_delegate].ansible_fqdn) }}" k3s_registration_address: "{{ hostvars[k3s_control_delegate].ansible_host | default(hostvars[k3s_control_delegate].ansible_fqdn) }}"
@ -113,13 +122,6 @@
when: k3s_registration_address is not defined when: k3s_registration_address is not defined
or k3s_control_delegate is not defined or k3s_control_delegate is not defined
- name: Ensure k3s_runtime_config is set for control plane
ansible.builtin.set_fact:
k3s_runtime_config: "{{ (k3s_server | default({})) | combine((k3s_agent | default({}))) }}"
when:
- (k3s_server is defined or k3s_agent is defined)
- (k3s_control_node is defined and k3s_control_node)
- name: Ensure k3s_runtime_config is set for agents - name: Ensure k3s_runtime_config is set for agents
ansible.builtin.set_fact: ansible.builtin.set_fact:
k3s_runtime_config: "{{ (k3s_agent | default({})) }}" k3s_runtime_config: "{{ (k3s_agent | default({})) }}"