Define local facts separately only for distro

We do define local facts locally using python_venv_build role so no need
to do the same as a separate task for source installs. Though these
facts are still needed for distro path.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/862924
Change-Id: I2f7f1281d19d61a7b4cbf14369aa3bb007debd0d
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/866126
This commit is contained in:
Dmitriy Rabotyagov 2022-12-06 13:09:46 +01:00
parent fc87fa7b32
commit a8a338fb99

View File

@ -37,6 +37,8 @@
delay: 2
tags:
- nova-pip-packages
notify:
- "Restart nova services"
- name: Install the python venv
import_role:
@ -123,21 +125,31 @@
condition: "{{ serial_proxy_enabled.rc is defined and serial_proxy_enabled.rc == 0 }}"
type: "serialconsole"
- name: Initialise the upgrade facts
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: nova
option: "{{ item.name }}"
value: "{{ item.state }}"
with_items:
- name: "need_service_restart"
state: "True"
- name: "need_online_data_migrations"
state: "True"
when:
- (install_packages is changed) or
(ansible_local is not defined) or
('openstack_ansible' not in ansible_local) or
('nova' not in ansible_local['openstack_ansible']) or
('need_online_data_migrations' not in ansible_local['openstack_ansible']['nova']) or
('need_service_restart' not in ansible_local['openstack_ansible']['nova'])
- name: Record local facts for distro path
when: nova_install_method == 'distro'
block:
- name: Record the osa version deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: nova
option: venv_tag
value: "{{ nova_venv_tag }}"
- name: Initialise the upgrade facts
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: nova
option: "{{ item.name }}"
value: "{{ item.state }}"
with_items:
- name: "need_service_restart"
state: "True"
- name: "need_online_data_migrations"
state: "True"
when:
- (install_packages is changed) or
(ansible_local is not defined) or
('openstack_ansible' not in ansible_local) or
('nova' not in ansible_local['openstack_ansible']) or
('need_online_data_migrations' not in ansible_local['openstack_ansible']['nova']) or
('need_service_restart' not in ansible_local['openstack_ansible']['nova'])