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