From 35f30a61b10e5c054a8ecc57710e7063127ee9ae Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 29 May 2020 14:20:23 +0100 Subject: [PATCH] Fix external API interface with out an IP address Steps to reproduce: * Define a separate network for the external API network * Don't define a cidr field for the new network (prevents IPs being allocated to hosts on this network) * Set the vip_address field for the network (and optionally fqdn) * kayobe overcloud host configure * kayobe overcloud service deploy * kayobe overcloud host configure (again) On the final command, keepalived will have created a VIP on the interface, causing the command to fail with an error like the following: Interface eth0 has an IPv4 address but none was requested This change fixes the issue by passing the VIP address as an allowed address to the MichaelRigart.interfaces role. This depends on https://github.com/michaelrigart/ansible-role-interfaces/pull/71. Change-Id: Ic86c0ca1b8209c968cb20a11bb3f40da71f296d0 Story: 2007736 Task: 39902 --- ansible/filter_plugins/networks.py | 9 +++++++++ .../notes/external-api-no-ip-f04951ffc9659949.yaml | 8 ++++++++ requirements.yml | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/external-api-no-ip-f04951ffc9659949.yaml diff --git a/ansible/filter_plugins/networks.py b/ansible/filter_plugins/networks.py index e9c8f6b7b..3c3650e07 100644 --- a/ansible/filter_plugins/networks.py +++ b/ansible/filter_plugins/networks.py @@ -211,6 +211,8 @@ def net_interface_obj(context, name, inventory_hostname=None): rules = net_rules(context, name, inventory_hostname) bootproto = net_bootproto(context, name, inventory_hostname) defroute = net_defroute(context, name, inventory_hostname) + vip_address = net_vip_address(context, name, inventory_hostname) + allowed_addresses = [vip_address] if vip_address else None interface = { 'device': device, 'address': ip, @@ -222,6 +224,7 @@ def net_interface_obj(context, name, inventory_hostname=None): 'rules': rules, 'bootproto': bootproto or 'static', 'defroute': defroute, + 'allowed_addresses': allowed_addresses, 'onboot': 'yes', } interface = {k: v for k, v in interface.items() if v is not None} @@ -255,6 +258,8 @@ def net_bridge_obj(context, name, inventory_hostname=None): rules = net_rules(context, name, inventory_hostname) bootproto = net_bootproto(context, name, inventory_hostname) defroute = net_defroute(context, name, inventory_hostname) + vip_address = net_vip_address(context, name, inventory_hostname) + allowed_addresses = [vip_address] if vip_address else None interface = { 'device': device, 'address': ip, @@ -267,6 +272,7 @@ def net_bridge_obj(context, name, inventory_hostname=None): 'rules': rules, 'bootproto': bootproto or 'static', 'defroute': defroute, + 'allowed_addresses': allowed_addresses, 'onboot': 'yes', } interface = {k: v for k, v in interface.items() if v is not None} @@ -306,6 +312,8 @@ def net_bond_obj(context, name, inventory_hostname=None): rules = net_rules(context, name, inventory_hostname) bootproto = net_bootproto(context, name, inventory_hostname) defroute = net_defroute(context, name, inventory_hostname) + vip_address = net_vip_address(context, name, inventory_hostname) + allowed_addresses = [vip_address] if vip_address else None interface = { 'device': device, 'address': ip, @@ -324,6 +332,7 @@ def net_bond_obj(context, name, inventory_hostname=None): 'rules': rules, 'bootproto': bootproto or 'static', 'defroute': defroute, + 'allowed_addresses': allowed_addresses, 'onboot': 'yes', } interface = {k: v for k, v in interface.items() if v is not None} diff --git a/releasenotes/notes/external-api-no-ip-f04951ffc9659949.yaml b/releasenotes/notes/external-api-no-ip-f04951ffc9659949.yaml new file mode 100644 index 000000000..7cd59f488 --- /dev/null +++ b/releasenotes/notes/external-api-no-ip-f04951ffc9659949.yaml @@ -0,0 +1,8 @@ +--- +fixes: + - | + Fixes an issue when configuring the external API network interface on + controllers without an IP address which would cause ``kayobe overcloud host + configure`` to fail on a host with an active virtual IP address. See + `story 2007736 `__ for + details. diff --git a/requirements.yml b/requirements.yml index 97acbb0d2..623a3627c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -5,7 +5,7 @@ # There are no versioned releases of this role. version: a5c3c19d0cda7b6960c9200a30b5dbe73d2eef96 - src: MichaelRigart.interfaces - version: v1.4.1 + version: v1.5.0 - src: mrlesmithjr.manage-lvm version: v0.1.4 - src: mrlesmithjr.mdadm