ansible: added support for symlinks on openwrt/image role
authorChristian Pointner <equinox@realraum.at>
Sat, 29 Dec 2018 05:03:31 +0000 (06:03 +0100)
committerChristian Pointner <equinox@realraum.at>
Sat, 29 Dec 2018 05:03:31 +0000 (06:03 +0100)
ansible/roles/openwrt/image/tasks/prepare.yml

index 3414371..ff6a613 100644 (file)
     - "{{ openwrt_mixin | map('dirname') | map('regex_replace', '^', openwrt_imgbuilder_files) | unique | list }}"
 
 
-- name: Copy mixins in place [1/2]
+- name: Copy mixins in place [1/3]
+  file:
+    dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
+    src: "{{ item.value.link }}"
+    force: yes
+    follow: no
+    state: link
+  with_dict: "{{ openwrt_mixin }}"
+  when: '"link" in item.value'
+  loop_control:
+    label: "{{ item.key }}"
+
+- name: Copy mixins in place [2/3]
   copy:
     src: "{{ item.value.file }}"
     dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
@@ -29,7 +41,7 @@
   loop_control:
     label: "{{ item.key }}"
 
-- name: Copy mixins in place [2/2]
+- name: Copy mixins in place [3/3]
   copy:
     content: "{{ item.value.content }}"
     dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"