2 - name: Create temporary build directory
8 openwrt_imgbuilder_dir: "{{ tmpdir.path }}"
9 openwrt_imgbuilder_files: "{{ tmpdir.path }}/files"
11 - name: Create the directories for mixins
17 - "{{ openwrt_download_dir }}/dl/{{ openwrt_arch }}"
18 - "{{ openwrt_imgbuilder_files }}/etc/config"
19 - "{{ openwrt_mixin | map('dirname') | map('regex_replace', '^', openwrt_imgbuilder_files) | unique | list }}"
22 - name: Copy mixins in place [1/2]
24 src: "{{ item.value.file }}"
25 dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
26 mode: "{{ item.value.mode | default('0644') }}"
27 with_dict: "{{ openwrt_mixin }}"
28 when: '"file" in item.value'
30 label: "{{ item.key }}"
32 - name: Copy mixins in place [2/2]
34 content: "{{ item.value.content }}"
35 dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
36 mode: "{{ item.value.mode | default('0644') }}"
37 with_dict: "{{ openwrt_mixin }}"
38 when: '"content" in item.value'
40 label: "{{ item.key }}"
42 - name: Generate /etc/fstab
44 fstab: "{{ openwrt_imgbuilder_files }}/etc/fstab"
46 src: "{{ item.src | default(omit) }}"
47 path: "{{ item.path | default(omit) }}"
48 fstype: "{{ item.fstype | default(omit) }}"
49 opts: "{{ item.opts | default(omit) }}"
50 boot: "{{ item.boot | default(omit) }}"
51 dump: "{{ item.dump | default(omit) }}"
52 passno: "{{ item.passno | default(omit) }}"
53 when: openwrt_mounts is defined
54 with_items: "{{ openwrt_mounts }}"
56 label: "{{ item.path }}"
59 - name: Create UCI configuration files
62 dest: "{{ openwrt_imgbuilder_files }}/etc/config/{{ item.key }}"
65 # force: no ## TODO: fail when overwriting a file
66 with_dict: "{{ openwrt_uci }}"
68 label: "{{ item.key }}"
70 - name: Create /etc/passwd
73 dest: "{{ openwrt_imgbuilder_files }}/etc/passwd"
76 when: openwrt_users is defined
78 - name: Create /etc/group
81 dest: "{{ openwrt_imgbuilder_files }}/etc/group"
84 when: openwrt_groups is defined or openwrt_users is defined
88 src: "{{ openwrt_download_dir }}/{{ openwrt_tarball_name }}"
89 dest: "{{ openwrt_imgbuilder_dir }}"
91 - name: Symlink the cache repository
94 src: "{{ openwrt_download_dir }}/dl/{{ openwrt_arch }}"
95 path: "{{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }}/dl"