Update cluster interface config to specify internal and external
This commit is contained in:
parent
28af9314ef
commit
8c69b7af95
@ -32,8 +32,8 @@ en1:
|
|||||||
skylab_targets: [cluster, datastore]
|
skylab_targets: [cluster, datastore]
|
||||||
skylab_roles:
|
skylab_roles:
|
||||||
- server
|
- server
|
||||||
- docker-swarm
|
|
||||||
- datastore
|
- datastore
|
||||||
|
- swarm
|
||||||
skylab_direct_peers:
|
skylab_direct_peers:
|
||||||
- hostname: pegasus.local jupiter.svr.local
|
- hostname: pegasus.local jupiter.svr.local
|
||||||
address: 192.168.42.10
|
address: 192.168.42.10
|
||||||
@ -49,7 +49,9 @@ en1:
|
|||||||
skylab_description: Arbiter Node
|
skylab_description: Arbiter Node
|
||||||
skylab_cluster:
|
skylab_cluster:
|
||||||
address: 10.42.101.10/24
|
address: 10.42.101.10/24
|
||||||
interface: bond0
|
interface:
|
||||||
|
access: bond0
|
||||||
|
internal: bond0.99
|
||||||
skylab_networking:
|
skylab_networking:
|
||||||
eno1:
|
eno1:
|
||||||
bond: bond0
|
bond: bond0
|
||||||
@ -78,7 +80,9 @@ en1:
|
|||||||
skylab_description: Operational Node
|
skylab_description: Operational Node
|
||||||
skylab_cluster:
|
skylab_cluster:
|
||||||
address: 10.42.101.11/24
|
address: 10.42.101.11/24
|
||||||
interface: bond0
|
interface:
|
||||||
|
access: bond0
|
||||||
|
internal: bond0.99
|
||||||
skylab_networking:
|
skylab_networking:
|
||||||
eno1:
|
eno1:
|
||||||
bond: bond0
|
bond: bond0
|
||||||
@ -107,7 +111,9 @@ en1:
|
|||||||
skylab_description: Operational Node
|
skylab_description: Operational Node
|
||||||
skylab_cluster:
|
skylab_cluster:
|
||||||
address: 10.42.101.12/24
|
address: 10.42.101.12/24
|
||||||
interface: bond0
|
interface:
|
||||||
|
access: bond0
|
||||||
|
internal: bond0.99
|
||||||
skylab_datastore_device: sdb
|
skylab_datastore_device: sdb
|
||||||
skylab_networking:
|
skylab_networking:
|
||||||
eno1:
|
eno1:
|
||||||
|
@ -43,10 +43,10 @@
|
|||||||
- name: Set common fact for node addresses
|
- name: Set common fact for node addresses
|
||||||
vars:
|
vars:
|
||||||
_node_addresses:
|
_node_addresses:
|
||||||
- "{{ lookup('vars', 'ansible_' + skylab_cluster.interface).ipv4.address }}"
|
- "{{ lookup('vars', 'ansible_' + skylab_cluster.interface.access).ipv4.address }}"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_node_addresses: "{{ _node_addresses + [item.address] }}"
|
_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:
|
loop_control:
|
||||||
label: "{{ item.address }}"
|
label: "{{ item.address }}"
|
||||||
|
|
||||||
@ -117,7 +117,7 @@
|
|||||||
become: true
|
become: true
|
||||||
when: skylab_cluster.address | ansible.netcommon.ipaddr('address') in _node_addresses
|
when: skylab_cluster.address | ansible.netcommon.ipaddr('address') in _node_addresses
|
||||||
ansible.builtin.command:
|
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
|
changed_when: true
|
||||||
|
|
||||||
- name: Assign address to alt node
|
- name: Assign address to alt node
|
||||||
@ -125,5 +125,5 @@
|
|||||||
become: true
|
become: true
|
||||||
when: skylab_cluster.address | ansible.netcommon.ipaddr('address') not in hostvars[_target_alt]._node_addresses
|
when: skylab_cluster.address | ansible.netcommon.ipaddr('address') not in hostvars[_target_alt]._node_addresses
|
||||||
ansible.builtin.command:
|
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
|
changed_when: true
|
||||||
|
Reference in New Issue
Block a user