---
- name: Stopping swift-rsyncd container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_rsyncd"
  when: (inventory_hostname in groups['swift-account-server'] or
          inventory_hostname in groups['swift-container-server'] or
          inventory_hostname in groups['swift-object-server']) and
          'swift_rsyncd' not in skip_stop_containers

- name: Stopping swift-account-server container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_account_server"
  when:
    - inventory_hostname in groups['swift-account-server']
    - "'swift_account_server' not in skip_stop_containers"

- name: Stopping swift-account-auditor container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_account_auditor"
  when:
    - inventory_hostname in groups['swift-account-server']
    - "'swift_object_auditor' not in skip_stop_containers"

- name: Stopping swift-account-replicator container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_account_replicator"
  when:
    - inventory_hostname in groups['swift-account-server']
    - "'swift_account_replicator' not in skip_stop_containers"

- name: Stopping swift-account-reaper container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_account_reaper"
  when:
    - inventory_hostname in groups['swift-account-server']
    - "'swift_account_reaper' not in skip_stop_containers"

- name: Stopping swift-container-server container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_container_server"
  when:
    - inventory_hostname in groups['swift-container-server']
    - "'swift_container_server' not in skip_stop_containers"

- name: Stopping swift-container-auditor container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_container_auditor"
  when:
    - inventory_hostname in groups['swift-container-server']
    - "'swift_container_auditor' not in skip_stop_containers"

- name: Stopping swift-container-replicator container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_container_replicator"
  when:
    - inventory_hostname in groups['swift-container-server']
    - "'swift_container_replicator' not in skip_stop_containers"

- name: Stopping swift-container-updater container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_container_updater"
  when:
    - inventory_hostname in groups['swift-container-server']
    - "'swift_container_updater' not in skip_stop_containers"

- name: Stopping swift-object-server container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_object_server"
  when:
    - inventory_hostname in groups['swift-object-server']
    - "'swift_object_server' not in skip_stop_containers"

- name: Stopping swift-object-auditor container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_object_auditor"
  when:
    - inventory_hostname in groups['swift-object-server']
    - "'swift_object_auditor' not in skip_stop_containers"

- name: Stopping swift-object-replicator container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_object_replicator"
  when:
    - inventory_hostname in groups['swift-object-server']
    - "'swift_object_replicator' not in skip_stop_containers"

- name: Stopping swift-object-updater container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_object_updater"
  when:
    - inventory_hostname in groups['swift-object-server']
    - "'swift_object_updater' not in skip_stop_containers"

- name: Stopping swift-object-expirer container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_object_expirer"
  when:
    - inventory_hostname in groups['swift-object-server']
    - "'swift_object_expirer' not in skip_stop_containers"

- name: Stopping swift-proxy-server container
  become: true
  kolla_docker:
    action: "stop_container"
    common_options: "{{ docker_common_options }}"
    name: "swift_proxy_server"
  when:
    - inventory_hostname in groups['swift-proxy-server']
    - "'swift_proxy_server' not in skip_stop_containers"
