Skip to content

Commit 77ad196

Browse files
Merge pull request #1219 from karelyatin/OSPRH-25940
[dataplane_adoption] Make netconfig mtu configurable
2 parents 6e7cb3d + b916d3a commit 77ad196

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

tests/roles/dataplane_adoption/defaults/main.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ libvirt_password: ''
1313
netconfig_networks:
1414
- name: ctlplane
1515
dnsDomain: ctlplane.example.com
16+
mtu: "{{ ctlplane_mtu | default(network_mtu) | default(1500) }}"
1617
subnets:
1718
- name: subnet1
1819
allocationRanges:
@@ -24,6 +25,7 @@ netconfig_networks:
2425
gateway: 192.168.122.1
2526
- name: internalapi
2627
dnsDomain: internalapi.example.com
28+
mtu: "{{ internalapi_mtu | default(network_mtu) | default(1500) }}"
2729
subnets:
2830
- name: subnet1
2931
allocationRanges:
@@ -33,6 +35,7 @@ netconfig_networks:
3335
vlan: 20
3436
- name: External
3537
dnsDomain: external.example.com
38+
mtu: "{{ external_mtu | default(network_mtu) | default(1500) }}"
3639
subnets:
3740
- name: subnet1
3841
allocationRanges:
@@ -43,6 +46,7 @@ netconfig_networks:
4346
vlan: 44
4447
- name: storage
4548
dnsDomain: storage.example.com
49+
mtu: "{{ storage_mtu | default(network_mtu) | default(1500) }}"
4650
subnets:
4751
- name: subnet1
4852
allocationRanges:
@@ -52,6 +56,7 @@ netconfig_networks:
5256
vlan: 21
5357
- name: storagemgmt
5458
dnsDomain: storagemgmt.example.com
59+
mtu: "{{ storagemgmt_mtu | default(network_mtu) | default(1500) }}"
5560
subnets:
5661
- name: subnet1
5762
allocationRanges:
@@ -61,6 +66,7 @@ netconfig_networks:
6166
vlan: 23
6267
- name: tenant
6368
dnsDomain: tenant.example.com
69+
mtu: "{{ tenant_mtu | default(network_mtu) | default(1500) }}"
6470
subnets:
6571
- name: subnet1
6672
allocationRanges:

tests/roles/dataplane_adoption/tasks/main.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828
file: ospdo.yaml
2929
when: ospdo_src| bool
3030

31+
- name: pre process netconfig_networks for mtu to be an integer
32+
ansible.builtin.set_fact:
33+
netconfig_networks_converted: >-
34+
{% set new_list = [] %}
35+
{% for net in netconfig_networks %}
36+
{% set _ = net.update({'mtu': net.mtu | int}) %}
37+
{% set _ = new_list.append(net) %}
38+
{% endfor %}
39+
{{ new_list }}
40+
when: configure_ipam | bool
41+
3142
- name: ensure IPAM is configured
3243
no_log: "{{ use_no_log }}"
3344
ansible.builtin.shell: |
@@ -39,7 +50,7 @@
3950
metadata:
4051
name: netconfig
4152
spec:
42-
networks: {{ netconfig_networks }}
53+
networks: {{ netconfig_networks_converted }}
4354
EOF
4455
when: configure_ipam | bool
4556

0 commit comments

Comments
 (0)