From: nicoo Date: Mon, 21 May 2018 00:01:13 +0000 (+0200) Subject: roles/openwrt-image: Cache downloaded files X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=493489f8e5e61ed2e827d0290299ed4bded956fb;p=noc.git roles/openwrt-image: Cache downloaded files --- diff --git a/ansible/roles/openwrt-image/tasks/prepare.yml b/ansible/roles/openwrt-image/tasks/prepare.yml index 7ed93d0..b0847ec 100644 --- a/ansible/roles/openwrt-image/tasks/prepare.yml +++ b/ansible/roles/openwrt-image/tasks/prepare.yml @@ -13,6 +13,7 @@ state: directory mode: '0755' with_items: + - "{{ openwrt_download_dir }}/dl" - "{{ openwrt_imgbuilder_files }}/etc/config" - "{{ openwrt_mixin | map('dirname') | map('regex_replace', '^', openwrt_imgbuilder_files) | unique | list }}" @@ -85,3 +86,9 @@ command: >- tar -xf "{{ openwrt_download_dir }}/{{ openwrt_tarball_name }}" -C "{{ openwrt_imgbuilder_dir }}" + +- name: Symlink the cache repository + file: + state: link + src: "{{ playbook_dir }}/{{ openwrt_download_dir }}/dl" + path: "{{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }}/dl"