From 96b3971438d055331506843e29e8de0fef592827 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Wed, 5 Sep 2018 17:18:05 +1200 Subject: [PATCH] Cleanup modify directory There is no need to let these directories clutter /tmp, unless the modify tasks fail, then it should be left to allow debugging. Change-Id: Ie258a997951cc17cee9d7b6978e7ecf53e3cffb6 --- tasks/modify_image.yml | 2 +- tasks/rpm_install.yml | 5 +++++ tasks/yum_update.yml | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/modify_image.yml b/tasks/modify_image.yml index 66a90b1..07985b7 100644 --- a/tasks/modify_image.yml +++ b/tasks/modify_image.yml @@ -30,7 +30,7 @@ insertafter: "^FROM " line: "LABEL modified_append_tag={{ modified_append_tag }}" -- name: Modify image +- name: Modify image from {{ modify_dir_path }} command: "{{ build_commands[container_build_tool] }} --tag {{ target_image | default(source_image) }}{{ modified_append_tag }} --file Dockerfile.modified --network host ./" become: true args: diff --git a/tasks/rpm_install.yml b/tasks/rpm_install.yml index c2cc158..2cba3a0 100644 --- a/tasks/rpm_install.yml +++ b/tasks/rpm_install.yml @@ -44,3 +44,8 @@ mode: '0555' - include_tasks: modify_image.yml + +- name: Clean modify directory + file: + state: absent + path: "{{ modify_dir_path }}" diff --git a/tasks/yum_update.yml b/tasks/yum_update.yml index cf7e428..47a8c33 100644 --- a/tasks/yum_update.yml +++ b/tasks/yum_update.yml @@ -69,3 +69,8 @@ mode: '0555' - include_tasks: modify_image.yml + +- name: Clean modify directory + file: + state: absent + path: "{{ modify_dir_path }}"