- block: - delegate_to: '{{ groups[''Undercloud''] | first }}' import_role: name: tripleo_ipa_cleanup name: unregister node from ipa server vars: tripleo_ipa_hosts_to_delete: - '{{ fqdn_canonical }}' tripleo_ipa_keytab: FILE:/etc/novajoin/krb5.keytab tags: down when: step|int == 1 - become: true block: - changed_when: false check_mode: false command: openstack compute service list --service nova-compute --column ID --column Host --format yaml delegate_to: '{{ groups[''Undercloud''] | first }}' name: Get nova-compute service ID register: nova_compute_service_result - name: is additional Cell? set_fact: is_additional_cell: false - check_mode: false delegate_to: '{{ groups[''Undercloud''] | first }}' name: Set fact for nova_compute services set_fact: nova_compute_service: '{{ nova_compute_service_result.stdout | from_yaml | selectattr(''Host'', ''match'', ansible_facts[''fqdn''] ~ ''.*'') | list }}' - fail: msg: Found multiple `{{ ansible_facts['fqdn'] }}`, which is unexpected. This means that the FQDN of the selected device to disable is either wrong or is sharing a name with another host, which is also wrong. Please correct this issue before continuing. Nova service list return data can be found here -> {{ nova_compute_service }}. name: Check search output when: - (nova_compute_service | length) > 1 - block: - check_mode: false command: openstack compute service set {{ nova_compute_service[0].Host }} nova-compute --disable delegate_to: '{{ groups[''Undercloud''] | first }}' name: Disable nova-compute service when: - not is_additional_cell|bool - become: true failed_when: ('msg' in stop_nova_compute and 'Could not find the requested service tripleo_nova_compute' not in stop_nova_compute.msg) or ('rc' in stop_nova_compute and stop_nova_compute.rc != 0) name: Stop nova-compute container register: stop_nova_compute service: enabled: false name: tripleo_nova_compute state: stopped - check_mode: false command: openstack compute service delete {{ nova_compute_service[0].ID }} delegate_to: '{{ groups[''Undercloud''] | first }}' name: Delete nova-compute service name: Disable nova services when: - (nova_compute_service | length) == 1 environment: OS_CLOUD: overcloud tags: down when: - step|int == 1 - container_cli == 'podman' - become: true block: - changed_when: false check_mode: false command: openstack network agent list --column ID --column Host --column Binary --format yaml delegate_to: '{{ groups[''Undercloud''] | first }}' name: Get neutron agents ID register: neutron_agents_result - check_mode: false delegate_to: '{{ groups[''Undercloud''] | first }}' name: Filter only current host set_fact: neutron_agents: '{{ neutron_agents_result.stdout | from_yaml | selectattr(''Host'', ''match'', ansible_facts[''fqdn''] ~ ''.*'') | list }}' - block: - become: true failed_when: ('msg' in stop_containers and 'Could not find the requested service' not in stop_containers.msg) or ('rc' in stop_containers and stop_containers.rc != 0) loop: - tripleo_ovn_controller - tripleo_ovn_metadata_agent name: Stop OVN containers register: stop_containers service: enabled: false name: '{{ item }}' state: stopped - check_mode: false command: openstack network agent delete {{ agent.ID }} delegate_to: '{{ groups[''Undercloud''] | first }}' loop: '{{ neutron_agents }}' loop_control: label: '{{ agent.Host }}/{{ agent.Binary }}' loop_var: agent name: Delete neutron agents name: Deleting OVN agents environment: OS_CLOUD: overcloud tags: down when: - step|int == 1 - container_cli == 'podman'