2021-06-08 00:40:54 +02:00
|
|
|
---
|
|
|
|
- name: install stuff
|
|
|
|
apt:
|
|
|
|
name:
|
|
|
|
- xorriso
|
|
|
|
- unzip
|
|
|
|
- genisoimage
|
|
|
|
update_cache: yes
|
|
|
|
|
|
|
|
- name: create project directory
|
|
|
|
file:
|
|
|
|
dest: /opt/ansiblepackages/debianunattended
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
- name: Download ISO Image
|
|
|
|
get_url:
|
2021-09-25 22:28:16 +02:00
|
|
|
url: "https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.0.0-amd64-netinst.iso"
|
|
|
|
dest: "/opt/ansiblepackages/debianunattended/debian-11.0.0-amd64-netinst.iso"
|
2021-06-08 00:40:54 +02:00
|
|
|
|
|
|
|
- name: delete old stuff
|
|
|
|
file:
|
|
|
|
path: /opt/ansiblepackages/debianunattended/isofiles/
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: extract ISO Image
|
2021-09-25 22:28:16 +02:00
|
|
|
command: xorriso -osirrox on -indev /opt/ansiblepackages/debianunattended/debian-11.0.0-amd64-netinst.iso -extract / /opt/ansiblepackages/debianunattended/isofiles/
|
2021-06-08 00:40:54 +02:00
|
|
|
args:
|
|
|
|
creates: /opt/ansiblepackages/debianunattended/isofiles/install.amd/initrd.gz
|
|
|
|
|
|
|
|
- name: generate /opt/ansiblepackages/debianunattended/preseed.cfg
|
|
|
|
template:
|
|
|
|
src: preseed.cfg.j2
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/preseed.cfg
|
|
|
|
|
|
|
|
- name: generate /opt/ansiblepackages/debianunattended/md5sum.sh
|
|
|
|
template:
|
|
|
|
src: md5sum.sh.j2
|
|
|
|
mode: "0755"
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/md5sum.sh
|
|
|
|
|
|
|
|
- name: generate /opt/ansiblepackages/debianunattended/mergepreseed.sh
|
|
|
|
template:
|
|
|
|
src: mergepreseed.sh.j2
|
|
|
|
mode: "0755"
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/mergepreseed.sh
|
|
|
|
|
|
|
|
- name: set permissions
|
|
|
|
file:
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/install.amd/
|
|
|
|
mode: +w
|
|
|
|
recurse: yes
|
|
|
|
|
|
|
|
- name: Extract isofiles/install.amd/initrd.gz
|
|
|
|
command: gunzip isofiles/install.amd/initrd.gz
|
|
|
|
args:
|
|
|
|
chdir: /opt/ansiblepackages/debianunattended/
|
|
|
|
|
|
|
|
- name: merge preseed.cfg
|
|
|
|
command: /opt/ansiblepackages/debianunattended/mergepreseed.sh
|
|
|
|
|
2021-06-12 00:27:47 +02:00
|
|
|
- name: generate /opt/ansiblepackages/debianunattended/isofiles/late_command.sh
|
|
|
|
template:
|
|
|
|
src: late_command.sh.j2
|
|
|
|
mode: "0755"
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/late_command.sh
|
|
|
|
|
|
|
|
- name: copy authorized_keys file
|
|
|
|
copy:
|
|
|
|
src: files/authorized_keys
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/authorized_keys
|
|
|
|
|
2021-06-08 00:40:54 +02:00
|
|
|
- name: compress isofiles/install.amd/initrd
|
|
|
|
command: gzip isofiles/install.amd/initrd
|
|
|
|
args:
|
|
|
|
chdir: /opt/ansiblepackages/debianunattended/
|
|
|
|
|
|
|
|
- name: set permissions
|
|
|
|
file:
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/install.amd/
|
|
|
|
mode: -w
|
|
|
|
recurse: yes
|
|
|
|
|
|
|
|
- name: set permissions
|
|
|
|
file:
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/md5sum.txt
|
|
|
|
mode: +w
|
|
|
|
|
|
|
|
- name: generate md5sums
|
|
|
|
command: /opt/ansiblepackages/debianunattended/md5sum.sh
|
|
|
|
|
|
|
|
- name: set permissions
|
|
|
|
file:
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/md5sum.txt
|
|
|
|
mode: -w
|
|
|
|
|
|
|
|
- name: set permissions
|
|
|
|
file:
|
|
|
|
dest: /opt/ansiblepackages/debianunattended/isofiles/isolinux/isolinux.bin
|
|
|
|
mode: +w
|
|
|
|
|
|
|
|
- name: genisoimage
|
2021-09-25 22:28:16 +02:00
|
|
|
command: genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /opt/ansiblepackages/debianunattended/debian-11.0.0-amd64-netinst-unattended-{{ debianunattended_hostname }}.iso /opt/ansiblepackages/debianunattended/isofiles
|