diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml index 3d51d3e98d..7c33fffc86 100644 --- a/playbooks/roles/nodepool-builder/tasks/main.yaml +++ b/playbooks/roles/nodepool-builder/tasks/main.yaml @@ -41,6 +41,10 @@ cmd: docker-compose up -d chdir: /etc/nodepool-builder-compose/ +- name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f + - name: Disable old service service: name: nodepool-builder diff --git a/playbooks/roles/nodepool-launcher/tasks/main.yaml b/playbooks/roles/nodepool-launcher/tasks/main.yaml index 85799ea964..f77c189ecf 100644 --- a/playbooks/roles/nodepool-launcher/tasks/main.yaml +++ b/playbooks/roles/nodepool-launcher/tasks/main.yaml @@ -54,6 +54,12 @@ include_tasks: start.yaml when: nodepool_launcher_start | bool +# We can prune here as it should leave the "latest" tagged images +# as well as the currently running images. +- name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f + - name: Disable old service service: name: nodepool-launcher diff --git a/playbooks/roles/nodepool-launcher/tasks/start.yaml b/playbooks/roles/nodepool-launcher/tasks/start.yaml index 02b8bd3905..bdfefc51bf 100644 --- a/playbooks/roles/nodepool-launcher/tasks/start.yaml +++ b/playbooks/roles/nodepool-launcher/tasks/start.yaml @@ -2,7 +2,3 @@ shell: cmd: docker-compose up -d chdir: /etc/nodepool-docker/ - -- name: Run docker prune to cleanup unneeded images - shell: - cmd: docker image prune -f diff --git a/playbooks/roles/zuul-merger/tasks/main.yaml b/playbooks/roles/zuul-merger/tasks/main.yaml index 0b407ed020..c550c0695b 100644 --- a/playbooks/roles/zuul-merger/tasks/main.yaml +++ b/playbooks/roles/zuul-merger/tasks/main.yaml @@ -51,6 +51,12 @@ include_tasks: start.yaml when: zuul_merger_start | bool +# We can prune here as it should leave the "latest" tagged images +# as well as the currently running images. +- name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f + - name: Disable old service service: name: zuul-merger diff --git a/playbooks/roles/zuul-merger/tasks/start.yaml b/playbooks/roles/zuul-merger/tasks/start.yaml index 68d603a4ee..c488671545 100644 --- a/playbooks/roles/zuul-merger/tasks/start.yaml +++ b/playbooks/roles/zuul-merger/tasks/start.yaml @@ -2,7 +2,3 @@ shell: cmd: docker-compose up -d chdir: /etc/zuul-merger - -- name: Run docker prune to cleanup unneeded images - shell: - cmd: docker image prune -f diff --git a/playbooks/roles/zuul-scheduler/tasks/main.yaml b/playbooks/roles/zuul-scheduler/tasks/main.yaml index 012a43d350..77d501cfc0 100644 --- a/playbooks/roles/zuul-scheduler/tasks/main.yaml +++ b/playbooks/roles/zuul-scheduler/tasks/main.yaml @@ -72,6 +72,12 @@ include_tasks: start.yaml when: zuul_scheduler_start is defined and zuul_scheduler_start | bool +# We can prune here as it should leave the "latest" tagged images +# as well as the currently running images. +- name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f + - name: Disable old service service: name: zuul-scheduler diff --git a/playbooks/roles/zuul-scheduler/tasks/start.yaml b/playbooks/roles/zuul-scheduler/tasks/start.yaml index 05902c7158..bee386e55e 100644 --- a/playbooks/roles/zuul-scheduler/tasks/start.yaml +++ b/playbooks/roles/zuul-scheduler/tasks/start.yaml @@ -2,8 +2,3 @@ shell: cmd: docker-compose up -d chdir: /etc/zuul-scheduler - -# TODO: put this in a handler -- name: Run docker prune to cleanup unneeded images - shell: - cmd: docker image prune -f diff --git a/playbooks/roles/zuul-web/tasks/main.yaml b/playbooks/roles/zuul-web/tasks/main.yaml index 1f1d2a8e06..5757b62218 100644 --- a/playbooks/roles/zuul-web/tasks/main.yaml +++ b/playbooks/roles/zuul-web/tasks/main.yaml @@ -100,6 +100,12 @@ include_tasks: start.yaml when: zuul_web_start | bool +# We can prune here as it should leave the "latest" tagged images +# as well as the currently running images. +- name: Run docker prune to cleanup unneeded images + shell: + cmd: docker image prune -f + - name: Disable old service service: name: 'zuul-{{ item }}' diff --git a/playbooks/roles/zuul-web/tasks/start.yaml b/playbooks/roles/zuul-web/tasks/start.yaml index 1aa4b16cd6..1498e6ee8f 100644 --- a/playbooks/roles/zuul-web/tasks/start.yaml +++ b/playbooks/roles/zuul-web/tasks/start.yaml @@ -2,7 +2,3 @@ shell: cmd: docker-compose up -d chdir: /etc/zuul-web - -- name: Run docker prune to cleanup unneeded images - shell: - cmd: docker image prune -f