TripleO Ansible project repository. Contains playbooks for use with TripleO OpenStack deployments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
889 B

- name: Make sure the container {{ container }} is stopped even if container_cli do not match
become: true
shell: |-
# We need to make sure that containers are stopped
# as we might have different CLIs to interact with
# them. I.e the container_cli might be setted to be podman
# but we might have the containers running with docker.
set -eu
if command -v podman && podman exec {{ container }} /bin/true; then
if systemctl status {{ container }}.service; then
systemctl stop {{ container }}.service
podman kill {{ container }}
if type docker &> /dev/null && docker exec {{ container }} /bin/true; then
docker stop {{ container }}
delegate_to: "{{ tripleo_delegate_to_item }}"
with_items: "{{ tripleo_delegate_to }}"
loop_var: tripleo_delegate_to_item