diff --git a/ansible/baremetal-compute-inspect.yml b/ansible/baremetal-compute-inspect.yml index 2f70d1d328b7c8e29268d0361cf62e7c370ec20e..0425c3cf6a6096c423043f18394ef38e0a7dfa71 100644 --- a/ansible/baremetal-compute-inspect.yml +++ b/ansible/baremetal-compute-inspect.yml @@ -3,20 +3,20 @@ # baremetal-compute ansible group are inspected. The nodes should be in the # 'manageable' state. -# We install shade in a virtualenv on one of the controllers, and delegate to +# We install openstacksdk in a virtualenv on one of the controllers, and delegate to # it when executing the stackhpc.os-ironic-state role. - name: Ensure dependencies are installed and the virtual environment is activated hosts: controllers[0] gather_facts: true vars: - venv: "{{ virtualenv_path }}/shade" + venv: "{{ virtualenv_path }}/openstacksdk" roles: - - role: stackhpc.os-shade - os_shade_venv: "{{ venv }}" - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - os_shade_upper_constraints_file: "{{ pip_upper_constraints_file }}" + - role: stackhpc.os_openstacksdk + os_openstacksdk_venv: "{{ venv }}" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + os_openstacksdk_upper_constraints_file: "{{ pip_upper_constraints_file }}" - role: activate-virtualenv activate_virtualenv_path: "{{ venv }}" diff --git a/ansible/baremetal-compute-manage.yml b/ansible/baremetal-compute-manage.yml index 5668a2c586a12ff551bda3130e679221363c1068..43c19dc1c023ac63522f3a156cd65527e482ecd4 100644 --- a/ansible/baremetal-compute-manage.yml +++ b/ansible/baremetal-compute-manage.yml @@ -3,20 +3,20 @@ # ironic inventory are manageable. Supported initial states include 'enroll', # 'manageable', and 'available'. -# We install shade in a virtualenv on one of the controllers, and delegate to +# We install openstacksdk in a virtualenv on one of the controllers, and delegate to # it when executing the stackhpc.os-ironic-state role. - name: Ensure baremetal compute nodes are available in ironic hosts: controllers[0] gather_facts: true vars: - venv: "{{ virtualenv_path }}/shade" + venv: "{{ virtualenv_path }}/openstacksdk" roles: - - role: stackhpc.os-shade - os_shade_venv: "{{ venv }}" - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - os_shade_upper_constraints_file: "{{ pip_upper_constraints_file }}" + - role: stackhpc.os_openstacksdk + os_openstacksdk_venv: "{{ venv }}" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + os_openstacksdk_upper_constraints_file: "{{ pip_upper_constraints_file }}" - role: activate-virtualenv activate_virtualenv_path: "{{ venv }}" diff --git a/ansible/baremetal-compute-provide.yml b/ansible/baremetal-compute-provide.yml index 37a720d44f7ccccb191bbb9f6e2fc82851bb20e6..7c01d5a90cfa5799fff5b6d0c14745e22477a69d 100644 --- a/ansible/baremetal-compute-provide.yml +++ b/ansible/baremetal-compute-provide.yml @@ -3,20 +3,20 @@ # ironic inventory are available. Supported initial states include 'enroll' and # 'manageable'. -# We install shade in a virtualenv on one of the controllers, and delegate to +# We install openstacksdk in a virtualenv on one of the controllers, and delegate to # it when executing the stackhpc.os-ironic-state role. - name: Ensure baremetal compute nodes are available in ironic hosts: controllers[0] gather_facts: true vars: - venv: "{{ virtualenv_path }}/shade" + venv: "{{ virtualenv_path }}/openstacksdk" roles: - - role: stackhpc.os-shade - os_shade_venv: "{{ venv }}" - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - os_shade_upper_constraints_file: "{{ pip_upper_constraints_file }}" + - role: stackhpc.os_openstacksdk + os_openstacksdk_venv: "{{ venv }}" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + os_openstacksdk_upper_constraints_file: "{{ pip_upper_constraints_file }}" - role: activate-virtualenv activate_virtualenv_path: "{{ venv }}" diff --git a/ansible/external-net.yml b/ansible/external-net.yml index 30753679c147e02aa33e7bc308b3b4a062011fdb..033646a8b82a30740fa2c495fb441087357848e8 100644 --- a/ansible/external-net.yml +++ b/ansible/external-net.yml @@ -4,10 +4,10 @@ hosts: controllers[0] roles: - role: stackhpc.os-networks - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - os_shade_upper_constraints_file: "{{ pip_upper_constraints_file }}" - os_networks_venv: "{{ virtualenv_path }}/shade" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + os_openstacksdk_upper_constraints_file: "{{ pip_upper_constraints_file }}" + os_networks_venv: "{{ virtualenv_path }}/openstacksdk" os_networks_openstack_auth_type: "{{ openstack_auth_type }}" os_networks_openstack_auth: "{{ openstack_auth }}" # Network configuration. diff --git a/ansible/overcloud-grafana-configure.yml b/ansible/overcloud-grafana-configure.yml index 8008c1e6f37c332f0243a6c9e9f8513590098336..5fd9cddc6e1e8912d6781b4b3d5ee28458723d1a 100644 --- a/ansible/overcloud-grafana-configure.yml +++ b/ansible/overcloud-grafana-configure.yml @@ -14,7 +14,7 @@ tags: - grafana vars: - venv: "{{ virtualenv_path }}/shade" + venv: "{{ virtualenv_path }}/openstacksdk" roles: - role: stackhpc.os-openstackclient os_openstackclient_venv: "{{ venv }}" diff --git a/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml b/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml index 06f6b3a29228071476706158da4c7dab50d0c6a0..99898436c9889f105c96cdb1ebce7e4c264d2794 100644 --- a/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml +++ b/ansible/overcloud-introspection-rules-dell-lldp-workaround.yml @@ -123,9 +123,9 @@ roles: - role: ironic-inspector-rules - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - ironic_inspector_venv: "{{ virtualenv_path }}/shade" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + ironic_inspector_venv: "{{ virtualenv_path }}/openstacksdk" ironic_inspector_upper_constraints_file: "{{ pip_upper_constraints_file }}" ironic_inspector_auth_type: "{{ openstack_auth_type }}" ironic_inspector_auth: "{{ openstack_auth }}" diff --git a/ansible/overcloud-introspection-rules.yml b/ansible/overcloud-introspection-rules.yml index 39b004df16510c1ab44ddf31dd1551b1c19c8281..c1d790cffa556ad7e22a664f7209c3aa96d67e27 100644 --- a/ansible/overcloud-introspection-rules.yml +++ b/ansible/overcloud-introspection-rules.yml @@ -15,7 +15,7 @@ tags: - introspection-rules vars: - venv: "{{ virtualenv_path }}/shade" + venv: "{{ virtualenv_path }}/openstacksdk" pre_tasks: - name: Validate OpenStack password authentication parameters fail: @@ -57,8 +57,8 @@ roles: - role: ironic-inspector-rules - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest ironic_inspector_venv: "{{ venv }}" ironic_inspector_upper_constraints_file: "{{ pip_upper_constraints_file }}" ironic_inspector_auth_type: "{{ openstack_auth_type }}" diff --git a/ansible/overcloud-ipa-images.yml b/ansible/overcloud-ipa-images.yml index a6015775cbec23946261cf88d8d6c6199fb63528..ec5fb5c75d049f6b0d1921b3c3504089b0e60f7d 100644 --- a/ansible/overcloud-ipa-images.yml +++ b/ansible/overcloud-ipa-images.yml @@ -99,9 +99,9 @@ - item.src != item.dest roles: - role: ipa-images - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - ipa_images_venv: "{{ virtualenv_path }}/shade" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + ipa_images_venv: "{{ virtualenv_path }}/openstacksdk" ipa_images_upper_constraints_file: "{{ pip_upper_constraints_file }}" ipa_images_openstack_auth_type: "{{ openstack_auth_type }}" ipa_images_openstack_auth: "{{ openstack_auth }}" diff --git a/ansible/provision-net.yml b/ansible/provision-net.yml index ba8a5a2a41f7bbba18d5f8b250f2db31baf905fb..6548e9d32a8830ac0d36249d430cb9eb79eb05a6 100644 --- a/ansible/provision-net.yml +++ b/ansible/provision-net.yml @@ -14,7 +14,7 @@ hosts: controllers_for_provision_net_True[0] gather_facts: False vars: - venv: "{{ virtualenv_path }}/shade" + venv: "{{ virtualenv_path }}/openstacksdk" provision_net: name: "{{ kolla_ironic_provisioning_network }}" provider_network_type: "{% if provision_wl_net_name | net_vlan %}vlan{% else %}flat{% endif %}" @@ -61,9 +61,9 @@ roles: - role: stackhpc.os-networks - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - os_shade_upper_constraints_file: "{{ pip_upper_constraints_file }}" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + os_openstacksdk_upper_constraints_file: "{{ pip_upper_constraints_file }}" os_networks_venv: "{{ venv }}" os_networks_auth_type: "{{ openstack_auth_type }}" os_networks_auth: "{{ openstack_auth }}" diff --git a/ansible/roles/ipa-images/defaults/main.yml b/ansible/roles/ipa-images/defaults/main.yml index 9f39ca3854cc95ad1c91c81f5b23d9d050e4bf50..13df4cf9fc6e894a42899ada16195aec238a2f7c 100644 --- a/ansible/roles/ipa-images/defaults/main.yml +++ b/ansible/roles/ipa-images/defaults/main.yml @@ -1,5 +1,5 @@ --- -# Path to virtualenv in which to install shade and its dependencies. +# Path to virtualenv in which to install openstacksdk and its dependencies. ipa_images_venv: # Upper constraints file for installation of python-ironicclient. diff --git a/ansible/roles/ipa-images/meta/main.yml b/ansible/roles/ipa-images/meta/main.yml index eb9d265823b8b3832734429903111996648bc6d2..a1914d381905d949853583996fdd9522d25e4e17 100644 --- a/ansible/roles/ipa-images/meta/main.yml +++ b/ansible/roles/ipa-images/meta/main.yml @@ -1,8 +1,8 @@ --- dependencies: - - role: stackhpc.os-shade - os_shade_venv: "{{ ipa_images_venv }}" - os_shade_upper_constraints_file: "{{ ipa_images_upper_constraints_file }}" + - role: stackhpc.os_openstacksdk + os_openstacksdk_venv: "{{ ipa_images_venv }}" + os_openstacksdk_upper_constraints_file: "{{ ipa_images_upper_constraints_file }}" - role: stackhpc.os-openstackclient os_openstackclient_venv: "{{ ipa_images_venv }}" os_openstackclient_upper_constraints_file: "{{ ipa_images_upper_constraints_file }}" diff --git a/ansible/roles/ironic-inspector-rules/README.md b/ansible/roles/ironic-inspector-rules/README.md index eeaee662bf3769d69b29add66cfe4e15d83c01f6..7a3bdb1d1bf0f6da54cc61c0d55a911f0f7109b6 100644 --- a/ansible/roles/ironic-inspector-rules/README.md +++ b/ansible/roles/ironic-inspector-rules/README.md @@ -36,7 +36,7 @@ for rules. Dependencies ------------ -This role depends on the Kayobe `shade` role. +This role depends on the Kayobe `openstacksdk` role. Example Playbook ---------------- diff --git a/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py b/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py index 7d75c9d7867fe534f73f9dcebb33e6207134e18d..c97f625f2e935925d034e8280e026772233e3d43 100644 --- a/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py +++ b/ansible/roles/ironic-inspector-rules/library/os_ironic_inspector_rule.py @@ -24,7 +24,7 @@ try: except Exception as e: IMPORT_ERRORS.append(e) try: - import shade + import openstack except Exception as e: IMPORT_ERRORS.append(e) @@ -76,17 +76,15 @@ os_ironic_inspector_rule: """ -def _build_client(module): +def _build_client(module, cloud): """Create and return an Ironic inspector client.""" - cloud = shade.operator_cloud(**module.params) - session = cloud.cloud_config.get_session() # Ensure the requested API version is supported. # API 1.14 is the latest API version available in Rocky. api_version = (1, 14) client = ironic_inspector_client.v1.ClientV1( inspector_url=module.params['inspector_url'], interface=module.params['interface'], - session=session, region_name=module.params['region_name'], + session=cloud.session, region_name=module.params['region_name'], api_version=api_version) return client @@ -161,8 +159,9 @@ def main(): endpoint=module.params['inspector_url'] ) + sdk, cloud = openstack_cloud_from_module(module) try: - client = _build_client(module) + client = _build_client(module, cloud) if module.params["state"] == "present": changed = _ensure_rule_present(module, client) else: diff --git a/ansible/roles/ironic-inspector-rules/meta/main.yml b/ansible/roles/ironic-inspector-rules/meta/main.yml index c775134e58f43692081fb101046c476356269ebb..68a2262c3a17c5bfc1f2122c6fa999f9ed881bfa 100644 --- a/ansible/roles/ironic-inspector-rules/meta/main.yml +++ b/ansible/roles/ironic-inspector-rules/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: - - role: stackhpc.os-shade - os_shade_venv: "{{ ironic_inspector_venv }}" - os_shade_upper_constraints_file: "{{ ironic_inspector_upper_constraints_file }}" + - role: stackhpc.os_openstacksdk + os_openstacksdk_venv: "{{ ironic_inspector_venv }}" + os_openstacksdk_upper_constraints_file: "{{ ironic_inspector_upper_constraints_file }}" diff --git a/ansible/seed-introspection-rules.yml b/ansible/seed-introspection-rules.yml index fca7eb08d75600685b1360aae87e892f20df69d5..e10395c685ba89c6bf74f946041873f36b492810 100644 --- a/ansible/seed-introspection-rules.yml +++ b/ansible/seed-introspection-rules.yml @@ -5,9 +5,9 @@ - introspection-rules roles: - role: ironic-inspector-rules - os_shade_install_epel: "{{ yum_install_epel }}" - os_shade_state: latest - ironic_inspector_venv: "{{ virtualenv_path }}/shade" + os_openstacksdk_install_epel: "{{ yum_install_epel }}" + os_openstacksdk_state: latest + ironic_inspector_venv: "{{ virtualenv_path }}/openstacksdk" ironic_inspector_upper_constraints_file: "{{ pip_upper_constraints_file }}" # No auth required for Bifrost. ironic_inspector_auth_type: None diff --git a/kayobe/ansible.py b/kayobe/ansible.py index c7b930bb8987ad198e87dcf89245cbd804315479..2cb355ee5004422684ad7df4b631644dcaa2e883 100644 --- a/kayobe/ansible.py +++ b/kayobe/ansible.py @@ -271,10 +271,7 @@ def prune_galaxy_roles(parsed_args): """ LOG.info("Removing unnecessary galaxy roles from kayobe") roles_to_remove = [ - 'stackhpc.os-flavors', - 'stackhpc.os-projects', - 'stackhpc.parted-1-1', - 'stackhpc.timezone', + 'stackhpc.os-shade', ] LOG.debug("Removing roles: %s", ",".join(roles_to_remove)) utils.galaxy_remove(roles_to_remove, "ansible/roles") diff --git a/kayobe/tests/unit/test_ansible.py b/kayobe/tests/unit/test_ansible.py index b1df9f5fb18296968218759b1d41bd64416f34f2..bb5540ca62f4b163de84fdded6c2d0805888b40b 100644 --- a/kayobe/tests/unit/test_ansible.py +++ b/kayobe/tests/unit/test_ansible.py @@ -468,10 +468,7 @@ class TestCase(unittest.TestCase): ansible.prune_galaxy_roles(parsed_args) expected_roles = [ - 'stackhpc.os-flavors', - 'stackhpc.os-projects', - 'stackhpc.parted-1-1', - 'stackhpc.timezone', + 'stackhpc.os-shade', ] mock_remove.assert_called_once_with(expected_roles, "ansible/roles") diff --git a/requirements.yml b/requirements.yml index 8502ca68b6b0d3aa184082ac0eab57a9d751ea81..950b8ef4565c9e8934e96555fb0bb6b0acb266bf 100644 --- a/requirements.yml +++ b/requirements.yml @@ -30,14 +30,14 @@ - src: stackhpc.mellanox-switch version: v1.0.0 - src: stackhpc.os-images - version: v1.7.0 + version: v1.8.0 - src: stackhpc.os-ironic-state - version: v1.2.0 + version: v1.3.0 - src: stackhpc.os-networks - version: v1.3.1 + version: v1.4.0 - src: stackhpc.os-openstackclient - version: v1.3.0 -- src: stackhpc.os-shade - version: v1.3.0 + version: v1.4.0 +- src: stackhpc.os_openstacksdk + version: v1.0.0 - src: yatesr.timezone version: 1.2.0