Allow the split of install and config

If keystone install is done separately from the config (filtering
or interruption), a re-run of the role will not mark the venv
as changed, and the db sync will not trigger.

Here we force a flush on file next to the venv change, and use
this file (local fact) as a way to know if a db sync is required.

When a dbsync is considered done, i.e after the expand and migrate
stages, we mark the db_migrate as done for all the nodes.

Change-Id: I318700582a65cc1ea6571d9460fd58bed949a4e9
Depends-On: Ie4a47e85bf31e1ac3a2bd6f0dec510bb24abdbbd
This commit is contained in:
Jean-Philippe Evrard 2017-03-31 12:50:16 +00:00
parent b183d949a9
commit cee7a02143
3 changed files with 29 additions and 4 deletions

View File

@ -50,5 +50,6 @@
- name: Check if Keystone DB sync contract is required
command: "true"
changed_when: keystone_db_sync_check.rc == 4
register: dbsync
notify:
- Perform a Keystone DB sync contract

View File

@ -251,3 +251,13 @@
dest: admin
- src: "{{ keystone_bin }}/keystone-wsgi-public"
dest: main
- name: Record the need for a db sync
ini_file:
dest: /etc/ansible/facts.d/keystone.fact
section: general
option: need_db_sync
value: True
when: keystone_get_venv | changed or
keystone_venv_dir | changed or
install_packages | changed

View File

@ -50,6 +50,12 @@
tags:
- keystone-install
- name: refresh local facts
setup:
filter: ansible_local
tags:
- keystone-config
- include: keystone_post_install.yml
tags:
- keystone-config
@ -81,10 +87,18 @@
- include: keystone_db_setup.yml
when:
- keystone_database_enabled | bool
- inventory_hostname == groups['keystone_all'][0]
- (keystone_get_venv is defined and keystone_get_venv | changed) or
(keystone_venv_dir is defined and keystone_venv_dir | changed) or
(install_packages is defined and install_packages | changed)
- inventory_hostname == ansible_play_hosts[0]
- ansible_local.keystone.general.need_db_sync | bool
tags:
- keystone-config
- name: Disable the need of a db sync on all nodes
ini_file:
dest: /etc/ansible/facts.d/keystone.fact
section: general
option: need_db_sync
value: False
when: dbsync | succeeded
tags:
- keystone-config