---
# This is necessary after new cells have been created to refresh the cell cache
# in nova scheduler.
- name: Refresh cell cache in nova scheduler
  become: true
  # NOTE(yoctozepto): Normally we would send the signal via Docker but, due to a
  # Docker bug (https://github.com/moby/moby/issues/11065), this might cause the
  # container to be stopped if we restart Docker or reboot the server as we
  # use the 'unless-stopped' restart policy by default.
  shell: "kill -HUP `{{ kolla_container_engine }} inspect -f '{% raw %}{{ .State.Pid }}{% endraw %}' nova_scheduler`"
  when:
    - inventory_hostname in groups['nova-scheduler']
