From bc0885f5397af9ee69f8c873e57ad6f3d7a360e1 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Mon, 21 Sep 2020 14:40:18 +0100 Subject: [PATCH] Fix seed VM configdrive when admin network is a VLAN The jriguera.configdrive role does not add VLAN=yes to the ifcfg script of a VLAN interface on the seed VM, unless type=vlan is passed in the network device list. This change passes this field for VLAN interfaces. Depends on https://github.com/jriguera/ansible-role-configdrive/pull/11 Change-Id: I6946b578f23843dd3cbafcb185b8d8cfbb00c080 Story: 2008089 Task: 40790 --- kayobe/plugins/filter/networks.py | 8 ++++++++ .../notes/configdrive-vlans-4e8b6ed07b229233.yaml | 6 ++++++ requirements.yml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/configdrive-vlans-4e8b6ed07b229233.yaml diff --git a/kayobe/plugins/filter/networks.py b/kayobe/plugins/filter/networks.py index a6c4b6cf7..1dd81ecf9 100644 --- a/kayobe/plugins/filter/networks.py +++ b/kayobe/plugins/filter/networks.py @@ -577,6 +577,11 @@ def net_configdrive_network_device(context, name, inventory_hostname=None): gateway = net_gateway(context, name, inventory_hostname) bootproto = net_bootproto(context, name, inventory_hostname) mtu = net_mtu(context, name, inventory_hostname) + vlan = net_vlan(context, name, inventory_hostname) + if vlan: + backend = [device.split('.')[0]] + else: + backend = None interface = { 'device': device, 'address': ip, @@ -584,7 +589,10 @@ def net_configdrive_network_device(context, name, inventory_hostname=None): 'gateway': gateway, 'bootproto': bootproto or 'static', 'mtu': mtu, + 'backend': backend, } + if vlan: + interface['type'] = 'vlan' interface = {k: v for k, v in interface.items() if v is not None} return interface diff --git a/releasenotes/notes/configdrive-vlans-4e8b6ed07b229233.yaml b/releasenotes/notes/configdrive-vlans-4e8b6ed07b229233.yaml new file mode 100644 index 000000000..a1012c3ca --- /dev/null +++ b/releasenotes/notes/configdrive-vlans-4e8b6ed07b229233.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Fixes an issue with the seed's configdrive when the admin network is a + VLAN. See `story 2008089 + `__ for details. diff --git a/requirements.yml b/requirements.yml index 2c6e8707d..b23291c0c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -6,7 +6,7 @@ roles: version: v1.0.1 - src: jriguera.configdrive # There are no versioned releases of this role. - version: e12d38378ae127c9c61d170fa4ba4729f2c5f2ad + version: 29871bf3279ef95fc8f7339b9abd13f869980750 - src: MichaelRigart.interfaces version: v1.12.0 - src: mrlesmithjr.chrony