Add advertised_address

This commit is contained in:
Anes Belfodil 2021-08-08 18:14:15 -04:00
parent 8c0c586607
commit c0ec5ca930
No known key found for this signature in database
GPG Key ID: 7BDFAE29F1DE8EFE
1 changed files with 18 additions and 0 deletions

View File

@ -102,6 +102,24 @@
check_mode: false
when: k3s_control_node_address is defined
- name: Ensure the node registration address is defined from server node ip
ansible.builtin.set_fact:
k3s_registration_address: "{{ hostvars[k3s_control_delegate].k3s_server['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
- name: Ensure the node registration address is defined
ansible.builtin.set_fact:
k3s_registration_address: "{{ hostvars[k3s_control_delegate].ansible_host | default(hostvars[k3s_control_delegate].ansible_fqdn) }}"