kolla-ansible/ansible/roles/bifrost/tasks/stop.yml
Mark Goddard 9cac1137d0 Add upgrade-bifrost command
This performs the same as a deploy-bifrost, but first stops the
bifrost services and container if they are running.

This can help where a docker stop may lead to an ungraceful shutdown,
possibly due to running multiple services in one container.

Change-Id: I131ab3c0e850a1d7f5c814ab65385e3a03dfcc74
Implements: blueprint bifrost-upgrade
Closes-Bug: #1834332
2019-07-02 14:30:14 +01:00

36 lines
1011 B
YAML

---
- block:
- name: Check if bifrost_deploy container is running
become: true
kolla_container_facts:
name:
- bifrost_deploy
register: container_facts
- block:
# Ensure that all services are stopped gracefully, and in a sensible
# order.
- name: Stop services gracefully
become: true
command: docker exec bifrost_deploy systemctl stop {{ item }}.service
with_items:
- ironic-api
- ironic-conductor
- ironic-inspector
- mariadb
- rabbitmq-server
- nginx
- name: Stopping bifrost_deploy container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "bifrost_deploy"
when: "'bifrost_deploy' in container_facts"
when:
- inventory_hostname in groups['bifrost']
- "'bifrost_deploy' not in skip_stop_containers"