Merge "Add memcache flushing handler on db migrations"

This commit is contained in:
Zuul 2018-10-22 19:07:18 +00:00 committed by Gerrit Code Review
commit 33e47cf314
2 changed files with 14 additions and 0 deletions

View File

@ -164,6 +164,17 @@
retries: 5
delay: 2
- name: Flush all of the cache in memcached
vars:
nc_command:
debian: nc -q 1 $(awk '/^\-l/ {print $2}' "/etc/memcached.conf" | awk -F, '{print $1}') $(awk '/^\-p/ {print $2}' "/etc/memcached.conf")
redhat: nc $(awk -F '-l' '/^OPTIONS/ {print $2}' "/etc/sysconfig/memcached" | awk -F ',' '{gsub(/"/, "", $1); print $1}' | awk -F '-' '{print $1}') 11211
suse: nc -w 1 $(awk -F '-l' '/^MEMCACHED_PARAMS/ {print $2}' "/etc/sysconfig/memcached" | awk -F ',' '{gsub(/"/, "", $1); print $1}' | awk -F '-' '{print $1}') 11211
shell: "echo 'flush_all' | {{ nc_command.get(ansible_os_family | lower) }}"
delegate_to: "{{ item }}"
with_items: "{{ groups.memcached_all }}"
listen: flush cache
- meta: noop
listen: Manage LB
when: false

View File

@ -102,6 +102,7 @@
when:
- "ansible_local['openstack_ansible']['keystone']['need_db_expand'] | bool"
run_once: yes
notify: flush cache
- name: Perform a Keystone DB sync migrate
command: "{{ keystone_bin }}/keystone-manage db_sync --migrate"
@ -110,6 +111,7 @@
when:
- "ansible_local['openstack_ansible']['keystone']['need_db_migrate'] | bool"
run_once: yes
notify: flush cache
- name: Perform a Keystone DB sync contract
command: "{{ keystone_bin }}/keystone-manage db_sync --contract"
@ -119,3 +121,4 @@
- "(keystone_all_software_updated | default('no')) | bool"
- "ansible_local['openstack_ansible']['keystone']['need_db_contract'] | bool"
run_once: yes
notify: flush cache