Merge pull request #52 from realraum/preseed/disk-selection
[noc.git] / ansible / roles / preseed / tasks / main.yml
1 - name: Copy initramfs into position
2   copy:
3     remote_src: yes
4     src: "{{ debian_installer_path | mandatory }}/{{ install_distro }}-{{ install_codename }}/{{ hostvars[hostname].install_cooked.arch | default('amd64') }}/initrd.gz"
5     dest: "{{ preseed_tmpdir }}/initrd.preseed.gz"
6
7 - name: Generate preseed file
8   template:
9     src: "preseed_{{ install_distro }}-{{ install_codename }}.cfg.j2"
10     dest: "{{ preseed_tmpdir }}/preseed.cfg"
11
12 - name: Generate authorized_keys file
13   authorized_key:
14     user: root
15     manage_dir: no
16     path: "{{ preseed_tmpdir }}/authorized_keys"
17     key: "{{ ssh_users_root | user_ssh_keys(users) | join('\n') }}"
18
19 - name: Inject files into initramfs
20   shell: cpio -H newc -o | gzip -9 >> 'initrd.preseed.gz'
21   args:
22     chdir: "{{ preseed_tmpdir }}"
23     stdin: |
24       preseed.cfg
25       authorized_keys
26   tags:
27   - skip_ansible_lint