Define venv_tag as separate task for distro

We do define venv_tag locally using python_venv_build role so no need
to do the same as a separate task for source installs. Though this task
is still needed for distro path.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/862924
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/866126
Change-Id: I49a45e68bd6030d4bd0667c8384a01088819f260
This commit is contained in:
Dmitriy Rabotyagov 2022-12-06 12:01:45 +01:00 committed by Dmitriy Rabotyagov
parent 1add87ad2f
commit 8017d4dd84

View File

@ -59,6 +59,7 @@
delay: 2
notify:
- Restart web server
- Restart uWSGI
- name: Install/remove apache mod packages for federated authentication
package:
@ -92,41 +93,47 @@
- section: "keystone"
option: "venv_tag"
value: "{{ keystone_venv_tag }}"
- section: "keystone"
option: "install_method"
value: "{{ keystone_install_method }}"
when: keystone_install_method == 'source'
# TODO(hwoarang): We need to have a venv_tag local fact deployed since we use it in the
# integration repo to determine if keystone software is the same across all nodes in the
# keystone_all group so we can safely run the DB migration. See
# https://github.com/openstack/openstack-ansible/blob/master/playbooks/os-keystone-install.yml
- name: Record the venv tag deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: keystone
option: venv_tag
value: "{{ keystone_venv_tag }}"
- name: Record local facts for distro path
when: keystone_install_method == 'distro'
block:
- name: Record the osa version deployed
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: keystone
option: venv_tag
value: "{{ keystone_venv_tag }}"
- name: Initialise the upgrade facts
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: keystone
option: "{{ item.name }}"
value: "{{ item.state }}"
with_items:
- name: "need_db_expand"
state: "True"
- name: "need_db_migrate"
state: "True"
- name: "need_db_contract"
state: "True"
- name: "install_method"
state: "{{ keystone_install_method }}"
when: (install_packages is changed) or
(ansible_local is not defined) or
('openstack_ansible' not in ansible_local) or
('keystone' not in ansible_local['openstack_ansible']) or
('need_db_expand' not in ansible_local['openstack_ansible']['keystone']) or
('need_db_migrate' not in ansible_local['openstack_ansible']['keystone']) or
('need_db_contract' not in ansible_local['openstack_ansible']['keystone'])
- name: Initialise the upgrade facts
ini_file:
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
section: keystone
option: "{{ item.name }}"
value: "{{ item.state }}"
with_items:
- name: "need_db_expand"
state: "True"
- name: "need_db_migrate"
state: "True"
- name: "need_db_contract"
state: "True"
- name: "install_method"
state: "{{ keystone_install_method }}"
when: (install_packages is changed) or
(ansible_local is not defined) or
('openstack_ansible' not in ansible_local) or
('keystone' not in ansible_local['openstack_ansible']) or
('need_db_expand' not in ansible_local['openstack_ansible']['keystone']) or
('need_db_migrate' not in ansible_local['openstack_ansible']['keystone']) or
('need_db_contract' not in ansible_local['openstack_ansible']['keystone'])
- name: Create WSGI symlinks
file: