From beb36b8ab9c67d497cbac81f5c011c7de15a465b Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Thu, 1 Mar 2018 05:53:15 -0600 Subject: [PATCH] Remove the "is_ssh_address" option from inventory The key **is_ssh_address** has been removed from the `openstack_user_config.yml` and the dynamic inventory. This key was responsible mapping an address to the container which was used for SSH connectivity. Because we've created the SSH connectivity plugin, which allows us the ability to connect to remote containers without SSH, this option is no longer useful. To keep the `openstack_user_config.yml` clean deployers can remove the option however moving forward it no longer has any effect. Change-Id: I9264b73dcef71eba9ac29b238683a3a8c53e7121 Signed-off-by: Kevin Carter --- .../openstack_user_config.yml.aio | 1 - .../openstack_user_config.yml.aio.j2 | 1 - .../openstack_user_config.yml.example | 5 ----- .../openstack_user_config.yml.pod.example | 4 ---- ...openstack_user_config.yml.prod-ceph.example | 1 - .../openstack_user_config.yml.prod.example | 1 - .../openstack_user_config.yml.test.example | 1 - osa_toolkit/generate.py | 18 +++++++----------- .../no-is_ssh_address-ee424e66b8895a07.yaml | 10 ++++++++++ tests/test_inventory.py | 5 ++--- 10 files changed, 19 insertions(+), 28 deletions(-) create mode 100644 releasenotes/notes/no-is_ssh_address-ee424e66b8895a07.yaml diff --git a/etc/openstack_deploy/openstack_user_config.yml.aio b/etc/openstack_deploy/openstack_user_config.yml.aio index 9beb0fcc0a..e02f35d350 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.aio +++ b/etc/openstack_deploy/openstack_user_config.yml.aio @@ -38,7 +38,6 @@ global_overrides: - all_containers - hosts is_container_address: true - is_ssh_address: true - network: container_bridge: "br-vxlan" container_type: "veth" diff --git a/etc/openstack_deploy/openstack_user_config.yml.aio.j2 b/etc/openstack_deploy/openstack_user_config.yml.aio.j2 index bd4f5b7fb9..e49d106f8c 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.aio.j2 +++ b/etc/openstack_deploy/openstack_user_config.yml.aio.j2 @@ -46,7 +46,6 @@ global_overrides: - all_containers - hosts is_container_address: true - is_ssh_address: true - network: container_bridge: "br-vxlan" container_type: "veth" diff --git a/etc/openstack_deploy/openstack_user_config.yml.example b/etc/openstack_deploy/openstack_user_config.yml.example index d50d6e242b..3908892095 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.example +++ b/etc/openstack_deploy/openstack_user_config.yml.example @@ -179,10 +179,6 @@ # If true, the load balancer uses this IP address to access services # in the container. Only valid for networks with 'ip_from_q' option. # -# Option: is_ssh_address (required, boolean) -# If true, Ansible uses this IP address to access the container via SSH. -# Only valid for networks with 'ip_from_q' option. -# # Option: group_binds (required, string) # List of one or more Ansible groups that contain this # network. For more information, see the env.d YAML files. @@ -254,7 +250,6 @@ # container_type: "veth" # ip_from_q: "container" # is_container_address: true -# is_ssh_address: true # - network: # group_binds: # - glance_api diff --git a/etc/openstack_deploy/openstack_user_config.yml.pod.example b/etc/openstack_deploy/openstack_user_config.yml.pod.example index c3c29f4095..04d166768a 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.pod.example +++ b/etc/openstack_deploy/openstack_user_config.yml.pod.example @@ -51,7 +51,6 @@ global_overrides: - hosts reference_group: "pod1_hosts" is_container_address: true - is_ssh_address: true # Containers in pod1 need routes to the container networks of other pods static_routes: # Route to container networks @@ -69,7 +68,6 @@ global_overrides: - hosts reference_group: "pod2_hosts" is_container_address: true - is_ssh_address: true # Containers in pod2 need routes to the container networks of other pods static_routes: # Route to container networks @@ -87,7 +85,6 @@ global_overrides: - hosts reference_group: "pod3_hosts" is_container_address: true - is_ssh_address: true # Containers in pod3 need routes to the container networks of other pods static_routes: # Route to container networks @@ -105,7 +102,6 @@ global_overrides: - hosts reference_group: "pod4_hosts" is_container_address: true - is_ssh_address: true # Containers in pod4 need routes to the container networks of other pods static_routes: # Route to container networks diff --git a/etc/openstack_deploy/openstack_user_config.yml.prod-ceph.example b/etc/openstack_deploy/openstack_user_config.yml.prod-ceph.example index 9451ab062e..92bba4b06a 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.prod-ceph.example +++ b/etc/openstack_deploy/openstack_user_config.yml.prod-ceph.example @@ -33,7 +33,6 @@ global_overrides: - all_containers - hosts is_container_address: true - is_ssh_address: true - network: container_bridge: "br-vxlan" container_type: "veth" diff --git a/etc/openstack_deploy/openstack_user_config.yml.prod.example b/etc/openstack_deploy/openstack_user_config.yml.prod.example index a49ea6ee20..3c16fd75f0 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.prod.example +++ b/etc/openstack_deploy/openstack_user_config.yml.prod.example @@ -32,7 +32,6 @@ global_overrides: - all_containers - hosts is_container_address: true - is_ssh_address: true - network: container_bridge: "br-vxlan" container_type: "veth" diff --git a/etc/openstack_deploy/openstack_user_config.yml.test.example b/etc/openstack_deploy/openstack_user_config.yml.test.example index dc489e89e3..435d83f5bd 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.test.example +++ b/etc/openstack_deploy/openstack_user_config.yml.test.example @@ -28,7 +28,6 @@ global_overrides: - all_containers - hosts is_container_address: true - is_ssh_address: true - network: container_bridge: "br-vxlan" container_type: "veth" diff --git a/osa_toolkit/generate.py b/osa_toolkit/generate.py index 0a4171716f..2b0d164b66 100755 --- a/osa_toolkit/generate.py +++ b/osa_toolkit/generate.py @@ -72,8 +72,8 @@ class ProviderNetworkMisconfiguration(Exception): self.queue_name = queue_name error_msg = ("Provider network with queue '{queue}' " - "requires 'is_container_address' and " - "'is_ssh_address' to be set to True.") + "requires 'is_container_address' " + "to be set to True.") self.message = error_msg.format(queue=self.queue_name) @@ -533,8 +533,8 @@ def network_entry(is_metal, interface, def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, bridge, net_type, net_mtu, user_config, - is_ssh_address, is_container_address, - static_routes, reference_group, address_prefix): + is_container_address, static_routes, + reference_group, address_prefix): """Process additional ip adds and append then to hosts as needed. If the host is found to be "is_metal" it will be marked as "on_metal" @@ -548,7 +548,6 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, :param netmask: ``str`` netmask to use. :param interface: ``str`` interface name to set for the network. :param user_config: ``dict`` user defined configuration details. - :param is_ssh_address: ``bol`` set this address as ansible_host. :param is_container_address: ``bol`` set this address to container_address. :param static_routes: ``list`` List containing static route dicts. :param reference_group: ``str`` group to filter membership of host against. @@ -571,7 +570,6 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, net_type, net_mtu, user_config, - is_ssh_address, is_container_address, static_routes, reference_group, @@ -640,7 +638,7 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, elif is_metal: network = networks[old_address] = _network network['netmask'] = netmask - if is_ssh_address or is_container_address: + if is_container_address: # Container physical host group cphg = container.get('physical_host_group') @@ -651,7 +649,7 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface, phg = user_config[cphg][physical_host] network['address'] = phg['ip'] - if is_ssh_address is True: + if is_container_address is True: container['ansible_host'] = networks[old_address]['address'] if is_container_address is True: @@ -738,7 +736,6 @@ def container_skel_load(container_skel, inventory, config): net_type=p_net.get('container_type'), net_mtu=p_net.get('container_mtu'), user_config=config, - is_ssh_address=p_net.get('is_ssh_address'), is_container_address=p_net.get('is_container_address'), static_routes=p_net.get('static_routes'), reference_group=p_net.get('reference_group'), @@ -1007,8 +1004,7 @@ def _check_config_settings(cidr_networks, config, container_skel): ) if (p_net.get('container_bridge') == overrides.get('management_bridge')): - if (not p_net.get('is_ssh_address') or - not p_net.get('is_container_address')): + if not p_net.get('is_container_address'): raise ProviderNetworkMisconfiguration(q_name) logger.debug("Provider network information OK") diff --git a/releasenotes/notes/no-is_ssh_address-ee424e66b8895a07.yaml b/releasenotes/notes/no-is_ssh_address-ee424e66b8895a07.yaml new file mode 100644 index 0000000000..f1e4e43e48 --- /dev/null +++ b/releasenotes/notes/no-is_ssh_address-ee424e66b8895a07.yaml @@ -0,0 +1,10 @@ +--- +upgrade: + - The key **is_ssh_address** has been removed from the + `openstack_user_config.yml` and the dynamic inventory. This key was + responsible mapping an address to the container which was used for SSH + connectivity. Because we've created the SSH connectivity plugin, which + allows us the ability to connect to remote containers without SSH, this + option is no longer useful. To keep the `openstack_user_config.yml` clean + deployers can remove the option however moving forward it no longer has any + effect. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index b07bb6c134..7e6e702acd 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -641,14 +641,13 @@ class TestConfigChecks(TestConfigCheckBase): def test_management_network_malformed(self): self.delete_provider_network_key('container', 'is_container_address') - self.delete_provider_network_key('container', 'is_ssh_address') self.write_config() with self.assertRaises(di.ProviderNetworkMisconfiguration) as context: get_inventory() expectedLog = ("Provider network with queue 'container' " - "requires 'is_container_address' and " - "'is_ssh_address' to be set to True.") + "requires 'is_container_address' " + "to be set to True.") self.assertEqual(str(context.exception), expectedLog) self.restore_config()