2 - name: Create temporary build directory
7 - name: set variables needed to build images
9 openwrt_imgbuilder_dir: "{{ tmpdir.path }}"
10 openwrt_imgbuilder_files: "{{ tmpdir.path }}/files"
12 - name: Create the directories for mixins
18 - "{{ openwrt_download_dir }}/dl/{{ openwrt_arch }}"
19 - "{{ openwrt_imgbuilder_files }}/etc/config"
20 - "{{ openwrt_mixin | map('dirname') | map('regex_replace', '^', openwrt_imgbuilder_files) | unique | list }}"
23 - name: Copy mixins in place [1/2]
25 src: "{{ item.value.file }}"
26 dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
27 mode: "{{ item.value.mode | default('0644') }}"
28 with_dict: "{{ openwrt_mixin }}"
29 when: '"file" in item.value'
31 label: "{{ item.key }}"
33 - name: Copy mixins in place [2/2]
35 content: "{{ item.value.content }}"
36 dest: "{{ openwrt_imgbuilder_files }}/{{ item.key }}"
37 mode: "{{ item.value.mode | default('0644') }}"
38 with_dict: "{{ openwrt_mixin }}"
39 when: '"content" in item.value'
41 label: "{{ item.key }}"
43 - name: Generate /etc/fstab
45 fstab: "{{ openwrt_imgbuilder_files }}/etc/fstab"
47 src: "{{ item.src | default(omit) }}"
48 path: "{{ item.path | default(omit) }}"
49 fstype: "{{ item.fstype | default(omit) }}"
50 opts: "{{ item.opts | default(omit) }}"
51 boot: "{{ item.boot | default(omit) }}"
52 dump: "{{ item.dump | default(omit) }}"
53 passno: "{{ item.passno | default(omit) }}"
54 when: openwrt_mounts is defined
55 with_items: "{{ openwrt_mounts }}"
57 label: "{{ item.path }}"
60 - name: Create UCI configuration files
63 dest: "{{ openwrt_imgbuilder_files }}/etc/config/{{ item.key }}"
66 # force: no ## TODO: fail when overwriting a file
67 with_dict: "{{ openwrt_uci }}"
69 label: "{{ item.key }}"
71 - name: Create /etc/passwd
74 dest: "{{ openwrt_imgbuilder_files }}/etc/passwd"
77 when: openwrt_users is defined
79 - name: Create /etc/group
82 dest: "{{ openwrt_imgbuilder_files }}/etc/group"
85 when: openwrt_groups is defined or openwrt_users is defined
87 - name: extract image builder tarball
90 src: "{{ openwrt_download_dir }}/{{ openwrt_tarball_name }}"
91 dest: "{{ openwrt_imgbuilder_dir }}"
93 - name: Symlink the cache repository
96 src: "{{ openwrt_download_dir }}/dl/{{ openwrt_arch }}"
97 path: "{{ openwrt_imgbuilder_dir }}/{{ openwrt_tarball_basename }}/dl"