From 931e88a63e2747bdda51c9bc74d0565dff4f76aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Wed, 13 Mar 2019 13:44:19 +0100 Subject: [PATCH] Undercloud - ironic inspector - host routes Configure the host_routes specified for subnets in undercloud.conf as classless static routes in ironic inspectors dnsmasq configuration. The advanced routing options will be pushed to the inspection ramdisk similar to the way they are already pushed to ironic-python-agent. Related-Bug: #1819464 Depends-On: I2229d386bff8ae63e4efe8406770b2b378a1991f Change-Id: I1afb720ae4ee4ce586c16a440e8edf8c2b23e155 --- ...ssless-static-routes-81ee8af8db74dbfe.yaml | 8 +++++++ .../tests/v1/undercloud/test_config.py | 23 +++++++++++++++++++ tripleoclient/v1/undercloud_config.py | 1 + 3 files changed, 32 insertions(+) create mode 100644 releasenotes/notes/undercloud-ironic-inspector-dnsmasq-classless-static-routes-81ee8af8db74dbfe.yaml diff --git a/releasenotes/notes/undercloud-ironic-inspector-dnsmasq-classless-static-routes-81ee8af8db74dbfe.yaml b/releasenotes/notes/undercloud-ironic-inspector-dnsmasq-classless-static-routes-81ee8af8db74dbfe.yaml new file mode 100644 index 000000000..59e3ad14f --- /dev/null +++ b/releasenotes/notes/undercloud-ironic-inspector-dnsmasq-classless-static-routes-81ee8af8db74dbfe.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + The routes defined using ``host_routes`` option for subnet definitions in + the Undercloud configuration is now also configured in ironic inspeactors + dnsmasq on the Undercloud. The advanced routing options will be pushed to + the inspection ramdisk similar to the way they are already pushed to + IPA (ironic-python-agent). diff --git a/tripleoclient/tests/v1/undercloud/test_config.py b/tripleoclient/tests/v1/undercloud/test_config.py index 4a46d47ed..b4d1f9d1f 100644 --- a/tripleoclient/tests/v1/undercloud/test_config.py +++ b/tripleoclient/tests/v1/undercloud/test_config.py @@ -166,6 +166,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -199,6 +200,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -225,6 +227,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.10.1', + 'host_routes': [], 'ip_range': '192.168.10.100,192.168.10.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -253,6 +256,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.10.1', + 'host_routes': [], 'ip_range': '192.168.10.100,192.168.10.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -280,6 +284,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -305,6 +310,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -331,6 +337,7 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}], @@ -379,14 +386,17 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}, {'gateway': '192.168.10.254', + 'host_routes': [], 'ip_range': '192.168.10.100,192.168.10.189', 'netmask': '255.255.255.0', 'tag': 'subnet1'}, {'gateway': '192.168.20.254', + 'host_routes': [], 'ip_range': '192.168.20.100,192.168.20.189', 'netmask': '255.255.255.0', 'tag': 'subnet2'} @@ -454,14 +464,17 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}, {'gateway': '192.168.10.254', + 'host_routes': [], 'ip_range': '192.168.10.100,192.168.10.189', 'netmask': '255.255.255.0', 'tag': 'subnet1'}, {'gateway': '192.168.20.254', + 'host_routes': [], 'ip_range': '192.168.20.100,192.168.20.189', 'netmask': '255.255.255.0', 'tag': 'subnet2'} @@ -509,10 +522,12 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}, {'gateway': '192.168.10.254', + 'host_routes': [], 'ip_range': '192.168.10.200,192.168.10.254', 'netmask': '255.255.255.0', 'tag': 'subnet1'}, @@ -554,10 +569,12 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}, {'gateway': '192.168.10.222', + 'host_routes': [], 'ip_range': '192.168.10.100,192.168.10.199', 'netmask': '255.255.255.0', 'tag': 'subnet1'}, @@ -618,14 +635,20 @@ class TestNetworkSettings(base.TestCase): 'DnsServers': '', 'IronicInspectorSubnets': [ {'gateway': '192.168.24.1', + 'host_routes': [{'destination': '10.10.10.254/32', + 'nexthop': '192.168.24.1'}], 'ip_range': '192.168.24.100,192.168.24.120', 'netmask': '255.255.255.0', 'tag': 'ctlplane-subnet'}, {'gateway': '192.168.10.254', + 'host_routes': [{'destination': '10.10.10.254/32', + 'nexthop': '192.168.10.254'}], 'ip_range': '192.168.10.100,192.168.10.189', 'netmask': '255.255.255.0', 'tag': 'subnet1'}, {'gateway': '192.168.20.254', + 'host_routes': [{'destination': '10.10.10.254/32', + 'nexthop': '192.168.20.254'}], 'ip_range': '192.168.20.100,192.168.20.189', 'netmask': '255.255.255.0', 'tag': 'subnet2'} diff --git a/tripleoclient/v1/undercloud_config.py b/tripleoclient/v1/undercloud_config.py index 3a28ba618..03a36d796 100644 --- a/tripleoclient/v1/undercloud_config.py +++ b/tripleoclient/v1/undercloud_config.py @@ -225,6 +225,7 @@ def _generate_inspection_subnets(): env_dict['ip_range'] = s.inspection_iprange env_dict['netmask'] = str(netaddr.IPNetwork(s.cidr).netmask) env_dict['gateway'] = s.gateway + env_dict['host_routes'] = s.host_routes env_list.append(env_dict) return env_list