Skolelinux-netboot-en

From pc-aid wiki
Revision as of 19:03, 27 December 2024 by Admin (talk | contribs)

skolelinux-netboot

source: https://git.nuug.no/nuug-public/skolelinux-netboot

This repository contains ansible tasks to set up a netboot server for the sole purpose of assisting in setting up laptops in the NUUG/Skolelinux dugnad. It is very specific to our current usecase, and may or may not be useful for anyone else.

Only Debian 12 with has been tested.

Getting started

You need a normal computer, with two network ports. Deoending on your needs, you may be ok with wifi to the internet, and an ethernet port (native or usb dongle) to the local pxe/netboot network. For bigger and more stable setups, a computer with two physical ethernet ports is recommended.

After your standard Debian 12 installation, configure your second network port for the local network you will be netbooting on. Make sure you have a big enough subnet to contain the number of clients you want to netboot at any given time.

The network configured on this interface, will be configured later for the DHCP server as well.

Make sure you upgrade all packages available, and after you've done the setup, reboot your netboot host to ensure it's running the latest kernel and your network ports have their IP addresses as needed.

You need to install ansible and git on your netboot host first:

su -

Enter the password for your user account and you are root.

apt install ansible git

Then run ansible-pull to run the tasks from this repository:

Then you can clone the public git repository used to set up the remainder of the netboot infrastructure:

git clone https://git.nuug.no/nuug-public/skolelinux-netboot.git

This will create the directory skolelinux-netboot/ that contains the ansible playbook and other data needed to configure the netboot host.

cd skolelinux-netboot

Configure local settings

Before running the playbook, you need to create a file local-vars.yml (this file is ignored by git) containing values the ansible playbook will use during the setup. Use your favourite editor to create the file, and fill it with the following data:

<internet_interface: "eno1" # Interface name that has internet access

# DHCP server configuration
dhcpd_interface: "enx7cc2c6469631" # Interface name for local netboot network
dhcpd_subnet_network: "192.168.100.0" # Network address for local network
dhcpd_subnet_netmask: "255.255.252.0" # Network netmask for local network
dhcpd_pool_start: "192.168.100.50" # DHCP IP pool start address
dhcpd_pool_end: "192.168.103.250" # DHCP IP pool end address
dhcpd_option_routers: "192.168.100.1" # Gateway for local network (your netboot host!)
dhcpd_option_domainnameservers: "1.1.1.1,1.0.0.1" # DNS servers to push to clients
dhcpd_option_nextserver: "192.168.100.1" # Netboot PXE server (your netboot host!)

# Full name, username and cleartext password of your desired non-root
# user to be created during preseed. This is going to be the user that
# is automatically logged in as the kiosk user.
preseed_user_fullname: ""
preseed_username: ""
preseed_user_password: ""

# Username and password that will be configured in ProFTP and that ShredOS will
# use to upload PDF reports # after shredding of disks.
proftpd_shredos_user: "someuser"
proftpd_shredos_pass: "somepass"

# A list of donors of laptops. IMPORTANT: Use only lowercase and uppalphanumeric
# (a-z, A-Z, 0-9), no spaces! Each donor will get their own ShredOS netboot menu
# choice, and their own ShredOS logs directory.
donors:
  - "bigcompany"
  - "district123"

Now you should be able to run the playbook that will perform all the necessary configuration tasks. This might take a little while.

ansible-playbook netboot-host-setup.yml -D

It's probably a good idea to reboot your netboot host again after this (assuming all went well), to make sure services start at boot (DHCP server, ProFTPd, Apt-cacher-ng). You can check with e.g.:

<systemctl status proftpd.service
systemctl status isc-dhcp-server.service
systemctl status apt-cacher-ng.service

You should now be able to use this host in the local network where you are performing the Skolelinux installations. This host should be the only DHCP server in the network, and the gateway IP must match what is being pushed by this host over DHCP.

If there are any changes in your local-vars.yml file, you should be able to simply re-run the playbook, and the system will be reconfigured accordingly.

If there are any new development for this setup made available in the git repository, you can update your files, by running a git command while being in the skolelinux-netboot/ directory:

git pull

To apply the latest changes, re-run the ansible playbook again.

share wireless internett to the netboot machine

a) Either start a preinstalled Debian 12 kde laptop with both wireless and ethernet network (cable), or boot a Debian live KDE from a USB-stick

b) When the system is started to Desktop -> left click the network icon in the bottom right corner and connect to a wireless network. Example Rebel-Network

c) Right click the network icon in the right corner of the screen again and do: > Configure Network Connections/Sett opp nettverkskoblinger -> Wired Connection 1 -> Kablet Forbindelse 1 -> IPv4 (tab/fane -> Method/Metode -> Shared to other computers / Delt til andre datamaskiner -> Use/Bruk

d)

e) Go to settings -> powermanagement/strømstyring -> On AC Power/På nettstørm (tab/fane) -> remove check mark for Lock session -> On battery/På batteridrift > remove check mark for Lock session -> On Low Battery/Lavt batterinivå remove check mark for Lock session -> click Use/Bruk

f) Connect a network cable from the network card on the laptop to Internet in network card on the preseed machine.