+ mode: "{{ item.value.mode | default('0644') }}"
+ with_dict: "{{ openwrt_mixin }}"
+ when: '"content" in item.value'
+ loop_control:
+ label: "{{ item.key }}"
+
+- name: Generate /etc/fstab
+ mount:
+ fstab: "{{ openwrt_imgbuilder_files }}/etc/fstab"
+ state: present
+ src: "{{ item.src | default(omit) }}"
+ path: "{{ item.path | default(omit) }}"
+ fstype: "{{ item.fstype | default(omit) }}"
+ opts: "{{ item.opts | default(omit) }}"
+ boot: "{{ item.boot | default(omit) }}"
+ dump: "{{ item.dump | default(omit) }}"
+ passno: "{{ item.passno | default(omit) }}"
+ when: openwrt_mounts is defined
+ with_items: "{{ openwrt_mounts }}"
+ loop_control:
+ label: "{{ item.path }}"
+
+
+- name: Create UCI configuration files
+ template:
+ src: uci.j2
+ dest: "{{ openwrt_imgbuilder_files }}/etc/config/{{ item.key }}"
+ mode: 0644
+ trim_blocks: yes
+# force: no ## TODO: fail when overwriting a file
+ with_dict: "{{ openwrt_uci }}"