- name: keycloak check for running containers command: pgrep -f quarkus ignore_errors: yes register: quarkus_pids - name: keycloak restart containers if running # Also makes sure the containers weren't just restarted by an image update when: quarkus_pids.rc == 0 and "is up-to-date" in keycloak_dcup.stderr block: - name: down containers shell: cmd: docker-compose -f /etc/keycloak-compose/docker-compose.yaml down - name: up containers shell: cmd: docker-compose -f /etc/keycloak-compose/docker-compose.yaml up -d