diff --git a/tasks/build/preconfigure-k3s.yml b/tasks/build/preconfigure-k3s.yml index 77ab842..4c73d7d 100644 --- a/tasks/build/preconfigure-k3s.yml +++ b/tasks/build/preconfigure-k3s.yml @@ -102,23 +102,14 @@ check_mode: false when: k3s_control_node_address is defined - - name: Ensure the node registration address is defined from server node ip + - name: Ensure the node registration address is defined from node-ip ansible.builtin.set_fact: - k3s_registration_address: "{{ hostvars[k3s_control_delegate].k3s_server['node-ip'] }}" + 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_server['node-ip'] is defined - - - name: Ensure the node registration address is defined from agent node ip - ansible.builtin.set_fact: - k3s_registration_address: "{{ hostvars[k3s_control_delegate].k3s_agent['node-ip'] }}" - check_mode: false - when: - - k3s_registration_address is not defined - - k3s_control_node_address is not defined - - hostvars[k3s_control_delegate].k3s_agent['node-ip'] is defined + - hostvars[k3s_control_delegate].k3s_runtime_config['node-ip'] is defined - name: Ensure the node registration address is defined ansible.builtin.set_fact: @@ -131,13 +122,6 @@ when: k3s_registration_address 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 ansible.builtin.set_fact: k3s_runtime_config: "{{ (k3s_agent | default({})) }}"