From ce62ad65e123d02ed6653f0974033a7d866450a6 Mon Sep 17 00:00:00 2001 From: Markus Brechtel Date: Mon, 1 Apr 2019 15:33:04 +0200 Subject: [PATCH 1/3] some improvements of installer --- templates/lb-config-args.j2 | 5 +++-- templates/preseed.cfg.j2 | 15 ++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/templates/lb-config-args.j2 b/templates/lb-config-args.j2 index 994f061..a68a4e9 100644 --- a/templates/lb-config-args.j2 +++ b/templates/lb-config-args.j2 @@ -15,8 +15,9 @@ {% if (debian_backports is defined) and (debian_backports == true) %} --backports true {% endif %} -{% if debian_live_debian_installer is defined %} ---debian-installer "{{ debian_live_debian_installer }}" +{% if live_build_debian_installer is defined %} +--debian-installer "{{ live_build_debian_installer }}" +--debian-installer-gui false {% if debian_nonfree_firmware %} --firmware-binary true {% endif %} diff --git a/templates/preseed.cfg.j2 b/templates/preseed.cfg.j2 index 2eb775d..ce6f7e6 100644 --- a/templates/preseed.cfg.j2 +++ b/templates/preseed.cfg.j2 @@ -14,9 +14,7 @@ d-i keyboard-configuration/toggle select No toggling ### Network console ### Hostname -{# -d-i netcfg/hostname string {{inventory_hostname}} -#} +{# d-i netcfg/hostname string {{inventory_hostname}} #} ### Mirror settings d-i mirror/country string manual @@ -25,13 +23,8 @@ d-i mirror/http/directory string /debian d-i mirror/http/proxy string ### Account setup -# Skip creation of a root account (normal user account will be able to -# use sudo). d-i passwd/root-login boolean true -# Alternatively, to skip creation of a normal user account. d-i passwd/make-user boolean false - -# Root password {% if root_password is defined %} d-i passwd/root-password-crypted password {{ root_password }} {% endif %} @@ -53,9 +46,9 @@ d-i partman/mount_style select uuid d-i partman/default_filesystem string btrfs ### Apt setup -# You can choose to install non-free and contrib software. -d-i apt-setup/non-free boolean {{ debian_nonfree_firmware }} -d-i apt-setup/contrib boolean {{ debian_nonfree_firmware }} +d-i apt-setup/use_mirror boolean true +d-i apt-setup/non-free boolean {{ debian_nonfree_firmware | default(false) }} +d-i apt-setup/contrib boolean {{ debian_nonfree_firmware | default(false) }} d-i apt-setup/services-select multiselect security,updates d-i apt-setup/security_host string security.debian.org From 83748de9a3c3a98d80d865bbf651937075fd3507 Mon Sep 17 00:00:00 2001 From: Markus Brechtel Date: Mon, 1 Apr 2019 15:46:33 +0200 Subject: [PATCH 2/3] Merge branch 'master' of git.devops.thengo.intranet:chaotika/ansible-role-live-build --- defaults/main.yml | 5 +++++ tasks/config.yaml | 31 ++++++++++++++++++++++++++++++- tasks/setup.yaml | 12 +++++------- templates/lb-config-args.j2 | 24 ------------------------ 4 files changed, 40 insertions(+), 32 deletions(-) delete mode 100644 templates/lb-config-args.j2 diff --git a/defaults/main.yml b/defaults/main.yml index 55390b5..a0a3a8b 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,3 +6,8 @@ live_build_bootappend_live: boot=live components quiet {{ live_build_serial_cons live_build_hostname: "{{ inventory_hostname }}" live_build_distribution: stretch + +debian_nonfree_firmware: true + +debian_live_debian_installer: live +live_build_directory: /opt/live diff --git a/tasks/config.yaml b/tasks/config.yaml index 504c39f..2009671 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -14,7 +14,36 @@ - name: lb config command: lb config - {{ lookup('template','lb-config-args.j2') }} + + {% if live_build_distribution is defined %} + --distribution "{{ live_build_distribution }}" + {% endif %} + + --mirror-bootstrap "{{ debian_mirror }}" + --mirror-chroot-security "{{ debian_security_mirror }}" + --mirror-binary "{{ debian_mirror }}" + --mirror-binary-security "{{ debian_security_mirror }}" + + {% if debian_nonfree_firmware %} + --archive-areas "main contrib non-free" + --firmware-chroot true + {% endif %} + + {% if live_build_bootappend_live is defined %} + --bootappend-live "{{ live_build_bootappend_live }}" + {% endif %} + + {% if (debian_backports is defined) and (debian_backports == true) %} + --backports true + {% endif %} + + {% if debian_live_debian_installer is defined %} + --debian-installer "{{ debian_live_debian_installer }}" + --debian-installer-gui "{{ live_build_debian_installer_gui | default(false) }}" + {% if debian_nonfree_firmware %} + --firmware-binary true + {% endif %} + {% endif %} args: chdir: "{{ live_build_directory }}" diff --git a/tasks/setup.yaml b/tasks/setup.yaml index 3d3d839..6dd2643 100644 --- a/tasks/setup.yaml +++ b/tasks/setup.yaml @@ -1,9 +1,7 @@ --- -- name: install apt packages +- name: debian packages apt: - pkg: "{{ item }}" - state: installed - with_items: - - live-build - - memtest86 - - memtest86+ + pkg: + - live-build + - memtest86 + - memtest86+ diff --git a/templates/lb-config-args.j2 b/templates/lb-config-args.j2 deleted file mode 100644 index a68a4e9..0000000 --- a/templates/lb-config-args.j2 +++ /dev/null @@ -1,24 +0,0 @@ -{% if live_build_distribution is defined %} ---distribution "{{ live_build_distribution }}" -{% endif %} ---mirror-bootstrap "{{ debian_mirror }}" ---mirror-chroot-security "{{ debian_security_mirror }}" ---mirror-binary "{{ debian_mirror }}" ---mirror-binary-security "{{ debian_security_mirror }}" -{% if debian_nonfree_firmware %} ---archive-areas "main contrib non-free" ---firmware-chroot true -{% endif %} -{% if live_build_bootappend_live is defined %} ---bootappend-live "{{ live_build_bootappend_live }}" -{% endif %} -{% if (debian_backports is defined) and (debian_backports == true) %} ---backports true -{% endif %} -{% if live_build_debian_installer is defined %} ---debian-installer "{{ live_build_debian_installer }}" ---debian-installer-gui false -{% if debian_nonfree_firmware %} ---firmware-binary true -{% endif %} -{% endif %} From 44c84d1d70315ce9da7579d78394c7011145e02d Mon Sep 17 00:00:00 2001 From: Markus Brechtel Date: Mon, 1 Apr 2019 15:53:46 +0200 Subject: [PATCH 3/3] remove merge artefacts --- tasks/config.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tasks/config.yaml b/tasks/config.yaml index 82b3ec2..2009671 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -39,10 +39,7 @@ {% if debian_live_debian_installer is defined %} --debian-installer "{{ debian_live_debian_installer }}" -<<<<<<< HEAD --debian-installer-gui "{{ live_build_debian_installer_gui | default(false) }}" -======= ->>>>>>> b3ddf4d5d15d8494bd5a720b8835e4e587db7973 {% if debian_nonfree_firmware %} --firmware-binary true {% endif %}