From f4b320338a44bca68c901a6d3ab5cd65fcf70d6c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Sun, 23 Jan 2022 11:05:10 -0500 Subject: [PATCH] Disable docker-cleanup job when 'testing: true'. If a container is in a crash loop, when the `docker-cleanup` script runs, it has a good chance of being removed. When doing tests, its not uncommon to be in a crash loop scenario while trying to resolve problems, and it is undesirable to have the container removed out from under you. This is particularly problematic when the container is large and/or the network between you and the registry is not optimal, as one has to repeatedly re-download the container. --- roles/float-base-docker/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/float-base-docker/tasks/main.yml b/roles/float-base-docker/tasks/main.yml index 6d08dcfc..1441ce3c 100644 --- a/roles/float-base-docker/tasks/main.yml +++ b/roles/float-base-docker/tasks/main.yml @@ -34,6 +34,7 @@ dest: /etc/cron.d/docker-cleanup content: "33 */3 * * * root runcron --quiet /usr/local/bin/docker-cleanup\n" mode: 0644 + when: "not testing|default(True)" - import_tasks: start.yml -- GitLab