file:
path: "{{ item }}"
state: directory
+ mode: '0755'
with_items:
- "{{ openwrt_imgbuilder_files }}/etc/config"
- "{{ openwrt_mixin | map('dirname') | map('regex_replace', '^', openwrt_imgbuilder_files) | unique | list }}"
- 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 }}"
loop_control:
label: "{{ item.key }}"
+- name: Create /etc/passwd
+ template:
+ src: passwd.j2
+ dest: "{{ openwrt_imgbuilder_files }}/etc/passwd"
+ mode: 0644
+ trim_blocks: yes
+ when: openwrt_users is defined
+
+- name: Create /etc/group
+ template:
+ src: group.j2
+ dest: "{{ openwrt_imgbuilder_files }}/etc/group"
+ mode: 0644
+ trim_blocks: yes
+ when: openwrt_groups is defined or openwrt_users is defined
### TODO: this just hangs?
# - unarchive: