Compare commits

...

4 Commits

Author SHA1 Message Date
rockstable 5d05021926 Add better error handling 2022-12-10 23:36:20 +01:00
rockstable 9bcbac6aea Fix typo 2022-12-10 23:35:38 +01:00
rockstable 8382e372a8 Move tasks for squashfs into nfsroot 2022-12-10 23:34:59 +01:00
rockstable 3bc3dbe301 Add support to set hostname 2022-12-10 23:34:08 +01:00
10 changed files with 48 additions and 4 deletions

View File

@ -39,6 +39,7 @@ fai_flags:
- sshd
- createvt
- menu
fai_install_hostname: "user-pc"
fai_hw4f_password_salt: "toXu6kiez1haetan"
fai_hw4f_rootpw_fai: "fai"

View File

@ -50,3 +50,23 @@
- fai_loguser is not none
- false
- name: "Check for squashfs image of nfsroot in '{{ fai_squashfs_path }}'"
ansible.builtin.stat:
path: "{{ fai_squashfs_path }}"
register: squashfs
tags:
- ipxe
- fai_squashfs_stat
- name: "Generate a squashfs of nfsroot filesystem in '{{ fai_squashfs_path }}'"
become: true
ansible.builtin.shell:
cmd: >
fai-cd -f -M -S "{{ fai_squashfs_path }}"
-d "{{ http_mirror_fai_profiles_url }}"
when:
- not squashfs.stat.exists or
fai_nfsroot_force_rebuild
tags:
- ipxe
- fai_squashfs_generate

View File

@ -53,7 +53,8 @@
fai-cd -f -M -S "{{ fai_squashfs_path }}"
-d "{{ http_mirror_fai_profiles_url }}"
when:
- not squashfs.stat.exists
- not squashfs.stat.exists or
fai_nfsroot_force_rebuild
tags:
- ipxe
- fai_squashfs_generate

View File

@ -104,6 +104,7 @@
import_tasks: fai-pxe.yml
tags:
- fai_pxe
- fai_ipxe
- name: "Configure FAI iPXE"
import_tasks: fai-ipxe.yml

View File

@ -75,7 +75,7 @@ goto start
:fai+reboot
kernel ${boot-root}/{{ fai_live_vmlinuz }}
initrd ${boot-root}/{{ fai_live_initrd }} || goto reload_after_fail
imgargs {{ fai_live_vmlinuz | basename }} ip=dhcp root=live:{{ http_mirror_fai_squashfs_url }} FAI_FLAGS={{{ fai_flags | join(',') }},reboot FAI_CONFIG_SRC={{ http_mirror_fai_profiles_url }} FAI_ACTION=install net.ifnames=0
imgargs {{ fai_live_vmlinuz | basename }} ip=dhcp root=live:{{ http_mirror_fai_squashfs_url }} FAI_FLAGS={{ fai_flags | join(',') }},reboot FAI_CONFIG_SRC={{ http_mirror_fai_profiles_url }} FAI_ACTION=install net.ifnames=0
boot || goto reload_after_fail
goto start

View File

@ -6,7 +6,7 @@ TIMEZONE="Europe/Berlin"
STOP_ON_ERROR=700
MAXPACKAGES=800
HOSTNAME="user-pc"
INSTALL_HOSTNAME="{{ fai_install_hostname }}"
KEYMAP="de-latin1-nodeadkeys"

View File

@ -1,5 +1,5 @@
#!/bin/bash
[ -f $target/etc/apt/apt.conf.d/02proxy ] && \
rm $target/etc/apt/apt.conf.d/02proxy
$ROOTCMD rm -v /etc/apt/apt.conf.d/02proxy

View File

@ -0,0 +1,15 @@
#!/bin/bash
error=0; trap 'error=$(($?>$error?$?:$error))'
if [ -n "$INSTALL_HOSTNAME" ]; then
echo "Setting HOSTNAME to '$INSTALL_HOSTNAME'"
echo "$INSTALL_HOSTNAME" > "$target/etc/hostname"
else
echo "Variable HOSTNAME is empty. Not setting HOSTNAME."
fi
echo "Removing FAI server from /etc/hosts"
sed -ri -e '/{{ server_name }}/d' "$target/etc/hosts"
exit $error

View File

@ -1,5 +1,7 @@
#!/bin/bash
error=0; trap 'error=$(($?>$error?$?:$error))'
### FAILS: snapd is not running during FAI
if [ "${#SNAPS[*]}" -eq 0 ]; then

View File

@ -1,7 +1,11 @@
#! /bin/bash
error=0; trap 'error=$(($?>$error?$?:$error))'
# disable the first login screen
$ROOTCMD dpkg-divert --local --rename --add /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
$ROOTCMD dpkg-divert --local --rename --add /etc/xdg/autostart/gnome-initial-setup-copy-worker.desktop
$ROOTCMD deluser --system gnome-initial-setup
$ROOTCMD dpkg-reconfigure keyboard-configuration
exit $error