kolla-ansible/ansible/roles/ceph/tasks/stop.yml
Mark Goddard b123bf6621 Use become for all docker tasks
Many tasks that use Docker have become specified already, but
not all. This change ensures all tasks that use the following
modules have become:

* kolla_docker
* kolla_ceph_keyring
* kolla_toolbox
* kolla_container_facts

It also adds become for 'command' tasks that use docker CLI.

Change-Id: I4a5ebcedaccb9261dbc958ec67e8077d7980e496
2019-06-06 19:04:58 +01:00

71 lines
1.9 KiB
YAML

---
- name: Stopping ceph-mon container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "ceph_mon"
when:
- inventory_hostname in groups['ceph-mon']
- "'ceph_mon' not in skip_stop_containers"
- name: Find running ceph-osds containers
become: true
command: "docker ps --filter name=ceph_osd_ --format {% raw %}{{.Names}}{% endraw %}"
register: ceph_osd_containers
- name: Stopping ceph-osd container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "{{ item }}"
with_items: "{{ ceph_osd_containers.stdout_lines }}"
when:
- inventory_hostname in groups['ceph-osd']
- ceph_osd_containers.stdout_lines | length >= 1
- item not in skip_stop_containers
- name: Stopping ceph-rgw container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "ceph_rgw"
when:
- inventory_hostname in groups['ceph-rgw']
- enable_ceph_rgw | bool
- "'ceph_rgw' not in skip_stop_containers"
- name: Stopping ceph-mgr container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "ceph_mgr"
when:
- inventory_hostname in groups['ceph-mgr']
- "'ceph_mgr' not in skip_stop_containers"
- name: Stopping ceph-mds container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "ceph_mds"
when:
- enable_ceph_mds | bool
- inventory_hostname in groups['ceph-mds']
- "'ceph_mds' not in skip_stop_containers"
- name: Stopping ceph-nfs container
become: true
kolla_docker:
action: "stop_container"
common_options: "{{ docker_common_options }}"
name: "ceph_nfs"
when:
- enable_ceph_nfs | bool
- inventory_hostname in groups['ceph-nfs']
- "'ceph_nfs' not in skip_stop_containers"