diff --git a/defaults/main.yml b/defaults/main.yml index 702bf9c..5d1e7b1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,34 +1,40 @@ -debian_installer_method: false -debian_installer_directory: host_files/{{ inventory_hostname }}/debian-installer -debian_installer_set_hostname: true -debian_installer_nonfree_firmware: false -debian_installer_cmdline: auto=true -cmdline: "" +--- +debian_installer_netboot_directory: /srv/netboot -debian_mirror: http://deb.debian.org/debian -debian_security_mirror: http://security.debian.org/debian-security -live_build_serial_console: false -live_build_bootappend_live: - boot=live - components - quiet - locales=de_DE.UTF-8 - timezone=Europe/Berlin - keyboard-layouts=de +# debian_installer_directory: host_files/{{ inventory_hostname }}/debian-installer -live_build_distribution: bullseye +# debian_installer_method: false +# debian_installer_directory: host_files/{{ inventory_hostname }}/debian-installer +# debian_installer_set_hostname: true +# debian_installer_nonfree_firmware: false +# debian_installer_cmdline: auto=true +# cmdline: "" -debian_nonfree_firmware: true +# debian_mirror: http://deb.debian.org/debian +# debian_security_mirror: http://security.debian.org/debian-security -debian_live_debian_installer: netinst -live_build_debian_installer_gui: false -live_build_directory: /opt/live +# live_build_serial_console: false +# live_build_bootappend_live: +# boot=live +# components +# quiet +# locales=de_DE.UTF-8 +# timezone=Europe/Berlin +# keyboard-layouts=de -live_build_desktop: false +# live_build_distribution: bullseye -live_build_iso_publisher: custom +# debian_nonfree_firmware: true -live_build_nice_level: 14 +# debian_live_debian_installer: netinst +# live_build_debian_installer_gui: false +# live_build_directory: /opt/live -live_build_linux_surface: false +# live_build_desktop: false + +# live_build_iso_publisher: custom + +# live_build_nice_level: 14 + +# live_build_linux_surface: false diff --git a/tasks/di-netboot-assistant.yaml b/tasks/di-netboot-assistant.yaml new file mode 100644 index 0000000..0099c4e --- /dev/null +++ b/tasks/di-netboot-assistant.yaml @@ -0,0 +1,6 @@ +--- + +- name: di-netboot-assistant config + template: + src: di-netboot-assistant/di-netboot-assistant.conf.j2 + dest: /etc/di-netboot-assistant/di-netboot-assistant.conf \ No newline at end of file diff --git a/tasks/method/kexec.yml b/tasks/kexec.yaml similarity index 100% rename from tasks/method/kexec.yml rename to tasks/kexec.yaml diff --git a/tasks/live-build.yaml b/tasks/live-build.yaml new file mode 100644 index 0000000..f0c3163 --- /dev/null +++ b/tasks/live-build.yaml @@ -0,0 +1,9 @@ +--- + +- name: debian live-build directory + file: + path: "{{ live_build_directory }}" + state: directory + +- import_tasks: config.yaml +- import_tasks: build.yaml diff --git a/tasks/main.yaml b/tasks/main.yaml index a4b86e8..81f22c3 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -2,10 +2,4 @@ - import_tasks: setup.yaml -- name: debian live-build directory - file: - path: "{{ live_build_directory }}" - state: directory - -- import_tasks: config.yaml -- import_tasks: build.yaml +- import_tasks: di-netboot-assistant.yaml diff --git a/tasks/main.yml b/tasks/main.yml deleted file mode 100644 index da945e2..0000000 --- a/tasks/main.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- - -# - import_tasks: setup.yml - -- name: directory - file: - state: directory - path: "{{debian_installer_directory}}" - -- import_tasks: preseed.yml - -- import_tasks: installer.yml - when: not debian_installer_method == false - -- import_tasks: method/kexec.yml - when: debian_installer_method == "kexec" diff --git a/tasks/preseed.yml b/tasks/preseed.yml index a5fd31f..3d90b45 100644 --- a/tasks/preseed.yml +++ b/tasks/preseed.yml @@ -1,16 +1,5 @@ --- -- name: run.sh - template: - src: run.sh.j2 - dest: "{{debian_installer_directory}}/run.sh" - -- name: stat run.sh - stat: - path: "{{debian_installer_directory}}/run.sh" - checksum_algorithm: md5 - register: run_sh - - name: preseed.cfg template: src: preseed.cfg.j2 diff --git a/tasks/setup.yaml b/tasks/setup.yaml index b8cddee..651940b 100644 --- a/tasks/setup.yaml +++ b/tasks/setup.yaml @@ -1,6 +1,22 @@ --- + - name: debian packages apt: pkg: - live-build + - simple-cdd + - di-netboot-assistant - memtest86+ + - cpio + - genisoimage + - syslinux + - isolinux + - pxelinux + - debian-installer-{{ansible_distribution_version}}-netboot-amd64 + - debian-installer-{{ansible_distribution_version}}-netboot-arm64 + +- name: directory + file: + state: directory + path: "{{debian_installer_netboot_directory}}" + diff --git a/tasks/setup.yml b/tasks/setup.yml deleted file mode 100644 index 6dda99b..0000000 --- a/tasks/setup.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- name: install required software - apt: - name: "{{item}}" - with_items: - - cpio - - debian-installer-9-netboot-amd64 - - genisoimage - - syslinux - - isolinux - - pxelinux - -- name: download unofficial firmware for debian-installer - get_url: - url: http://cdimage.debian.org/cdimage/unofficial/non-free/firmware/stable/current/firmware.cpio.gz - dest: /opt/debian-installer-unofficial-firmware.cpio.gz - when: debian_installer_nonfree_firmware diff --git a/templates/di-netboot-assistant/di-netboot-assistant.conf.j2 b/templates/di-netboot-assistant/di-netboot-assistant.conf.j2 new file mode 100644 index 0000000..de4eb41 --- /dev/null +++ b/templates/di-netboot-assistant/di-netboot-assistant.conf.j2 @@ -0,0 +1,40 @@ +{{ansible_managed|comment}} + +#Configuration file for di-netboot-assistant + +#TFTP root directory (for netboot). +# You will have to adjust the directory according to the tftp server setting. +# Use option '--tftproot=DIR' to overwrite temporarily. +TFTP_ROOT={{debian_installer_netboot_directory}} + +#Download Mirror +# The variable MIRROR_REGEXPS contain a list of space separated sed +# regular expression, to rewrite di-sources.list URLs, to match your +# prefered mirror. For example, in older releases the following has +# been used (adapted in di-sources.list now): +MIRROR_REGEXPS="s=://deb.debian.org/dists/=://deb.debian.org/debian/dists/=" + +## non-free firmware base URL: +NONFREE_FW="https://cdimage.debian.org/cdimage/unofficial/non-free/firmware/" + +#Location of the keyring to verify the signature of the downloaded +# images: +DEBIAN_KEYRING="/usr/share/keyrings/debian-archive-keyring.gpg" +UBUNTU_KEYRING="/usr/share/keyrings/ubuntu-archive-keyring.gpg" + +# Debian-installer arguments. +# The arguments listed here will be appended to the one provided by +# the debian-installer pristine images (see di-netboot-assistant manpage). +#DI_ARGS="locale=en_US console-keymaps-at/keymap=fr-latin1 mirror/country=manual mirror/http/hostname=http.de.debian.org mirror/http/directory=/debian mirror/http/proxy=" + +# Boot arguments for installed (target) system. +# The arguments listed here will be appended to the one provided by +# the debian-installer pristine images (see di-netboot-assistant manpage). +#TARGET_ARGS="vga=791" + +## URL to fetch the squashfs image of the root file system from for Debian Live. +## Default ist the TFTP-server, however, you might want to provide a faster way. +#SQUASHIMG='tftp://10.0.2.2/${LIVE_DIR}/${ISO_NAME}/live/filesystem.squashfs' +#SQUASHIMG="http://192.168.0.10/${ISO_NAME}/live/filesystem.squashfs" +## For GRUB, the ${pxe_default_server} variable can be used: +SQUASHIMG='tftp://\${pxe_default_server}/${LIVE_DIR}/${ISO_NAME}/live/filesystem.squashfs' diff --git a/templates/run.sh.j2 b/templates/run.sh.j2 deleted file mode 100644 index 744eebc..0000000 --- a/templates/run.sh.j2 +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -mkdir -p /.ssh -cat > /.ssh/authorized_keys << EOF -{% if root_ssh_authorized_keys is defined %} -{% for key in root_ssh_authorized_keys %} -{{key}} -{% endfor %} -{% endif %} -EOF