aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/bifrost/tasks/stop.yml
blob: 2c7bfe6786821fd914ccb3803cc8174a98cf9bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
- when:
    - inventory_hostname in groups['bifrost']
    - "'bifrost_deploy' not in skip_stop_containers"
  block:
    - name: Check if bifrost_deploy container is running
      become: true
      kolla_container_facts:
        action: get_containers
        container_engine: "{{ kolla_container_engine }}"
        name:
          - bifrost_deploy
      register: container_facts

    - when: container_facts.containers['bifrost_deploy'] is defined
      block:
        # Ensure that all services are stopped gracefully, and in a sensible
        # order.
        - name: Stop services gracefully
          become: true
          command: "{{ kolla_container_engine }} exec bifrost_deploy systemctl stop {{ item }}.service"
          with_items:
            - ironic
            - mariadb
            - nginx

        - name: Stopping bifrost_deploy container
          become: true
          kolla_container:
            action: "stop_container"
            common_options: "{{ docker_common_options }}"
            name: "bifrost_deploy"