Update cluster config var to include public+private addresses
This commit is contained in:
@@ -37,12 +37,12 @@
|
||||
vars:
|
||||
_cluster_node_ips: []
|
||||
ansible.builtin.set_fact:
|
||||
_cluster_node_ips: "{{ _cluster_node_ips + [hostvars[item].skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix')] }}"
|
||||
_cluster_node_ips: "{{ _cluster_node_ips + [hostvars[item].skylab_cluster.address.access | ansible.netcommon.ipaddr('host/prefix')] }}"
|
||||
loop: "{{ groups.cluster }}"
|
||||
|
||||
- name: Remove alternative node IPs
|
||||
become: true
|
||||
when: item in _cluster_node_ips and item != (skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix'))
|
||||
when: item in _cluster_node_ips and item != (skylab_cluster.address.access | ansible.netcommon.ipaddr('host/prefix'))
|
||||
ansible.builtin.command:
|
||||
cmd: ip address delete {{ item | ansible.netcommon.ipaddr('host/prefix') }} dev {{ skylab_cluster.interface.access }}
|
||||
changed_when: true
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
- name: Add node IP
|
||||
become: true
|
||||
when: skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix') not in _node_addresses
|
||||
when: skylab_cluster.address.access | ansible.netcommon.ipaddr('host/prefix') not in _node_addresses
|
||||
ansible.builtin.command:
|
||||
cmd: ip address add {{ skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix') }} dev {{ skylab_cluster.interface.access }}
|
||||
cmd: ip address add {{ skylab_cluster.address.access | ansible.netcommon.ipaddr('host/prefix') }} dev {{ skylab_cluster.interface.access }}
|
||||
changed_when: true
|
||||
|
||||
Reference in New Issue
Block a user