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: I5e4717a780a20914bba345bc0e0e275d6ee7b81f
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/866126
This commit is contained in:
Dmitriy Rabotyagov 2022-12-06 13:05:05 +01:00 committed by Dmitriy Rabotyagov
parent dd9051ed36
commit bfb256d49b
1 changed files with 25 additions and 13 deletions

View File

@ -35,6 +35,8 @@
until: install_packages is success
retries: 5
delay: 2
notify:
- "Restart cinder services"
- name: Install cinder packages from PIP
import_tasks: cinder_install_source.yml
@ -73,16 +75,26 @@
- cinder-config
- systemd-service
- name: Set the upgrade facts
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: cinder
option: "{{ item }}"
value: true
with_items:
- "need_online_data_migrations"
- "need_service_restart"
when:
(install_packages is changed) or
('need_online_data_migrations' not in ansible_local['openstack_ansible']['cinder']) or
('need_service_restart' not in ansible_local['openstack_ansible']['cinder'])
- name: Record local facts for distro path
when: cinder_install_method == 'distro'
block:
- name: Record the osa version deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: cinder
option: venv_tag
value: "{{ cinder_venv_tag }}"
- name: Set the upgrade facts
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: cinder
option: "{{ item }}"
value: true
with_items:
- "need_online_data_migrations"
- "need_service_restart"
when:
(install_packages is changed) or
('need_online_data_migrations' not in ansible_local['openstack_ansible']['cinder']) or
('need_service_restart' not in ansible_local['openstack_ansible']['cinder'])