Просмотр исходного кода

debian installer refactoring

main
Markus Katharina Brechtel 1 год назад
Родитель
Сommit
96735dad9e
11 измененных файлов: 103 добавлений и 87 удалений
  1. +31
    -25
      defaults/main.yml
  2. +6
    -0
      tasks/di-netboot-assistant.yaml
  3. +0
    -0
      tasks/kexec.yaml
  4. +9
    -0
      tasks/live-build.yaml
  5. +1
    -7
      tasks/main.yaml
  6. +0
    -16
      tasks/main.yml
  7. +0
    -11
      tasks/preseed.yml
  8. +16
    -0
      tasks/setup.yaml
  9. +0
    -18
      tasks/setup.yml
  10. +40
    -0
      templates/di-netboot-assistant/di-netboot-assistant.conf.j2
  11. +0
    -10
      templates/run.sh.j2

+ 31
- 25
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

+ 6
- 0
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

tasks/method/kexec.yml → tasks/kexec.yaml Просмотреть файл


+ 9
- 0
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

+ 1
- 7
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

+ 0
- 16
tasks/main.yml Просмотреть файл

@@ -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"

+ 0
- 11
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


+ 16
- 0
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}}"


+ 0
- 18
tasks/setup.yml Просмотреть файл

@@ -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

+ 40
- 0
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'

+ 0
- 10
templates/run.sh.j2 Просмотреть файл

@@ -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

Загрузка…
Отмена
Сохранить