diff --git a/handlers/main.yml b/handlers/main.yml index 2e71f13e..70ee35b4 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -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 diff --git a/tasks/keystone_db_setup.yml b/tasks/keystone_db_setup.yml index b6e8e4cd..bc98e378 100644 --- a/tasks/keystone_db_setup.yml +++ b/tasks/keystone_db_setup.yml @@ -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