fixup! roles/openwrt-image: Add support for setting file modes
authornicoo <nicoo@realraum.at>
Sun, 20 May 2018 21:36:14 +0000 (23:36 +0200)
committernicoo <nicoo@realraum.at>
Sun, 20 May 2018 21:36:14 +0000 (23:36 +0200)
ansible/roles/openwrt-image/tasks/prepare.yml
ansible/tuer.yml

index e049983..bf09f31 100644 (file)
 
 - name: Copy mixins in place [1/2]
   copy:
-    src: "{{ item.file }}"
+    src: "{{ item.value.file }}"
     dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
-    mode: "{{ item.mode | default(0644) }}"
+    mode: "{{ item.value.mode | default('0644') }}"
   with_dict: "{{ openwrt_mixin }}"
-  when: '"file" in item'
+  when: '"file" in item.value'
   loop_control:
     label: "{{ item.key }}"
 
 - name: Copy mixins in place [2/2]
   copy:
-    content: "{{ item.value }}"
+    content: "{{ item.value.content }}"
     dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
-    mode: "{{ item.mode | default(0644) }}"
+    mode: "{{ item.value.mode | default('0644') }}"
   with_dict: "{{ openwrt_mixin }}"
-  when: '"content" in item'
+  when: '"content" in item.value'
   loop_control:
     label: "{{ item.key }}"
 
index 0d90890..4b3bd7a 100644 (file)
         openwrt_mixin:
           # Go binaries
           /usr/local/bin/door_client:
-            mode: 0755
+            mode: '0755'
             file: "{{ playbook_dir }}/.cache/openwrt/tuer/door_and_sensors/door_client/door_client"
           /usr/local/bin/door_daemon:
-            mode: 0755
+            mode: '0755'
             file: "{{ playbook_dir }}/.cache/openwrt/tuer/door_and_sensors/door_daemon/door_daemon"
           /usr/local/bin/update-keys:
-            mode: 0755
+            mode: '0755'
             file: "{{ playbook_dir }}/.cache/openwrt/tuer/door_and_sensors/update-keys/update-keys"
 
           /usr/local/bin/authorized_keys.sh:
-            mode: 0755
+            mode: '0755'
             file: "{{ playbook_dir }}/files/tuer/authorized_keys.sh"
 
           /etc/ssh/sshd_config: