-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove relocation script * Update NMStateConfig * fix var * add dns * fix linter * update doc * remove dns config * fix MNO
- Loading branch information
Showing
13 changed files
with
91 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
name: | ||
- kubernetes | ||
- netaddr | ||
- jmespath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,60 @@ | ||
- name: Calculate relocatable IP | ||
when: edgeCluster.relocatable is defined | ||
block: | ||
- name: Increment relocatable IP address | ||
ansible.builtin.set_fact: | ||
interface_number: "{{ (interface_number | int) + 1 }}" | ||
|
||
- name: Filter the relocatable interface | ||
ansible.builtin.set_fact: | ||
filtered_interface: "{{ nmstate_host.networkConfig.interfaces | json_query('[?name == `' + edgeCluster.relocatable.interface + '`]') | first }}" | ||
|
||
- name: Create entry for IPv4 address list | ||
when: cluster_ipv4 | ||
block: | ||
- name: Get IPv4 addresses | ||
ansible.builtin.set_fact: | ||
ipv4_addresses: "{{ filtered_interface.ipv4.address | default([]) }}" | ||
|
||
- name: Append IPv4 relocatable address | ||
ansible.builtin.set_fact: | ||
ipv4_addresses: "{{ ipv4_addresses + [{'ip': relocatable_ipv4_subnet | ansible.utils.nthhost(interface_number | int), 'prefix-length': relocatable_ipv4_subnet | ansible.utils.ipaddr('prefix')}] }}" | ||
|
||
- name: Update IPv4 addresses | ||
ansible.builtin.set_fact: | ||
filtered_interface: "{{ filtered_interface | combine({'ipv4': {'address': ipv4_addresses}}, recursive=true) }}" | ||
|
||
- name: Create entry for IPv6 address list | ||
when: cluster_ipv6 | ||
block: | ||
- name: Get IPv6 addresses | ||
ansible.builtin.set_fact: | ||
ipv6_addresses: "{{ filtered_interface.ipv6.address | default([]) }}" | ||
|
||
- name: Append IPv6 relocatable address | ||
ansible.builtin.set_fact: | ||
ipv6_addresses: "{{ ipv6_addresses + [{'ip': relocatable_ipv6_subnet | ansible.utils.nthhost(interface_number | int), 'prefix-length': relocatable_ipv6_subnet | ansible.utils.ipaddr('prefix')}] }}" | ||
|
||
- name: Update IPv6 addresses | ||
ansible.builtin.set_fact: | ||
filtered_interface: "{{ filtered_interface | combine({'ipv6': {'address': ipv6_addresses}}, recursive=true) }}" | ||
|
||
- name: Get all non-reloctable interfaces | ||
ansible.builtin.set_fact: | ||
interfaces_list: "{{ nmstate_host.networkConfig.interfaces | json_query('[?name != `' + edgeCluster.relocatable.interface + '`]') }}" | ||
|
||
- name: Add reloctable interface | ||
ansible.builtin.set_fact: | ||
interfaces_list: "{{ interfaces_list + [filtered_interface] }}" | ||
|
||
- name: Create new networkConfig | ||
ansible.builtin.set_fact: | ||
relocatable_network_config: "{{ nmstate_host.networkConfig | combine({'interfaces': interfaces_list}, recursive=true) }}" | ||
|
||
- name: Create NMStateConfig | ||
kubernetes.core.k8s: | ||
template: NMStateConfig.yaml.j2 | ||
apply: true | ||
state: present | ||
register: k8s_result | ||
until: k8s_result is not failed | ||
|
||
- name: Calculate relocatable IP | ||
when: edgeCluster.relocatable is defined | ||
block: | ||
- name: Get relocatable interface index | ||
loop: "{{ nmstate_host.networkConfig.interfaces }}" | ||
loop_control: | ||
label: "{{ item.name }}" | ||
when: item.name == edgeCluster.relocatable.interface | ||
ansible.builtin.include_tasks: get_relocatable_ip.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
edge/roles/edge_install/templates/RelocatableConfig.yaml.j2
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
access_control_node: false | ||
node_ipv4_addresses: [] | ||
node_ipv6_addresses: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters