Update cluster interface config to specify internal and external
This commit is contained in:
		@@ -43,10 +43,10 @@
 | 
			
		||||
    - name: Set common fact for node addresses
 | 
			
		||||
      vars:
 | 
			
		||||
        _node_addresses:
 | 
			
		||||
          - "{{ lookup('vars', 'ansible_' + skylab_cluster.interface).ipv4.address }}"
 | 
			
		||||
          - "{{ lookup('vars', 'ansible_' + skylab_cluster.interface.access).ipv4.address }}"
 | 
			
		||||
      ansible.builtin.set_fact:
 | 
			
		||||
        _node_addresses: "{{ _node_addresses + [item.address] }}"
 | 
			
		||||
      loop: "{{ lookup('vars', 'ansible_' + skylab_cluster.interface).ipv4_secondaries }}"
 | 
			
		||||
      loop: "{{ lookup('vars', 'ansible_' + skylab_cluster.interface.access).ipv4_secondaries }}"
 | 
			
		||||
      loop_control:
 | 
			
		||||
        label: "{{ item.address }}"
 | 
			
		||||
 | 
			
		||||
@@ -117,7 +117,7 @@
 | 
			
		||||
      become: true
 | 
			
		||||
      when: skylab_cluster.address | ansible.netcommon.ipaddr('address') in _node_addresses
 | 
			
		||||
      ansible.builtin.command:
 | 
			
		||||
        cmd: ip address delete {{ skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix') }} dev {{ skylab_cluster.interface }}
 | 
			
		||||
        cmd: ip address delete {{ skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix') }} dev {{ skylab_cluster.interface.access }}
 | 
			
		||||
      changed_when: true
 | 
			
		||||
 | 
			
		||||
    - name: Assign address to alt node
 | 
			
		||||
@@ -125,5 +125,5 @@
 | 
			
		||||
      become: true
 | 
			
		||||
      when: skylab_cluster.address | ansible.netcommon.ipaddr('address') not in hostvars[_target_alt]._node_addresses
 | 
			
		||||
      ansible.builtin.command:
 | 
			
		||||
        cmd: ip address add {{ skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix') }} dev {{ hostvars[_target_alt].skylab_cluster.interface }}
 | 
			
		||||
        cmd: ip address add {{ skylab_cluster.address | ansible.netcommon.ipaddr('host/prefix') }} dev {{ hostvars[_target_alt].skylab_cluster.interface.access }}
 | 
			
		||||
      changed_when: true
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user