Skip to content

Commit b9ce1b5

Browse files
author
Christopher M. Neill
committed
this is a clusterfsck but it works
1 parent 35b8943 commit b9ce1b5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

ansible/roles/builder/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@
2929
- name: push docker image
3030
when: not do_not_push
3131
command: sudo docker push {{ container_image }}:{{ container_tag }}
32+
33+
- name: show current docker ps
34+
command: sudo docker ps

ansible/roles/container_kill_start/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# get current running container with this image
1717
- name: "look for running containers running {{ container_image }}"
18-
shell: "sudo docker ps | grep {{ container_image }}: | awk '{print $1}'"
18+
shell: "sudo docker ps | grep -v '^CONTAINER' | awk '{print $1,$2}' | grep -e {{ container_image }} -v -e ':'|awk -F' ' '{print $1}'"
1919
register: old_containers_id
2020
changed_when: old_containers_id.stdout != ''
2121

0 commit comments

Comments
 (0)