Ansible scripts for FRI classrooms
Find a file
2026-11-11 10:29:07 +01:00
roles make a better README 2026-11-10 08:33:17 +01:00
unattended_install Change generic Windows key 2025-09-11 13:17:30 +02:00
vars Set large_prog_dir to c:\ for this year 2026-09-05 07:50:58 +02:00
.gitignore Add software keys to .gitignore 2026-10-15 11:03:34 +02:00
ansible.cfg fix become method to sudo 2026-11-11 10:29:07 +01:00
inventory-nb.yml Add example inventory files 2026-10-14 11:27:49 +02:00
inventory.yml Add example inventory files 2026-10-14 11:27:49 +02:00
join_ad.yml Add join_ad playbook, define large_prog_dir 2025-09-11 13:20:49 +02:00
linsetup.yml remove commented roles 2026-10-15 14:19:51 +02:00
macsetup.yml Initial commit erasing history 2024-06-01 00:49:52 +02:00
pyproject.toml basic persistent configuration and uv 2026-11-10 10:43:37 +01:00
README.md make readme more readme-er 2026-11-10 08:33:19 +01:00
reboot.yml playbooks for reboot and wakeup 2026-11-10 10:43:37 +01:00
setup_base.yml make a better README 2026-11-10 08:33:17 +01:00
uv.lock basic persistent configuration and uv 2026-11-10 10:43:37 +01:00
wakeup.yml playbooks for reboot and wakeup 2026-11-10 10:43:37 +01:00
winsetup.yml make a better README 2026-11-10 08:33:17 +01:00

Ansible playbooks for setting up classrooms

This repository contains some of the main Ansible playbooks for deploying classroom (and library) computers at FRI. There is a growing aspiration to add any missing actions, including update procedures, into this repository as well.

The first part of deployment should run on a virtual machine, known as "the prototype". The local admin account on both operating systems should be named local_admin with the password that is saved in the IT department's Keepass password store. One should always double-check the prototype's IP address in the inventory file, as it may not be the same all the time.

Apple computers are handled completely differently. For now, there be dragons.

Setting up the prototype

Installing a common base set of software and customization:

For Windows and Linux, run something like:

ansible-playbook --user <local admin> -k -K -i inventory.yml setup_base.py

For Apple computers one would theoretically run something like:

ansible-playbook --user <local admin> -k -K -i inventory.yml macsetup.py

Installing software for classes:

For Windows:

ansible-playbook --user <local admin> -k -K -i inventory.yml winsetup.py

For Linux:

ansible-playbook --user <local admin> -k -K -i inventory.yml linsetup.py

Fix partition and filesystem UUIDs

In order to have the network-boot menu work after updates, we need to set partition and filesystem UUIDs to known fixed values. Playbook status: TODO

Create images of partitions and the partition table

We have a tool called FRI Backup that we use for creating compressed images of partitions and the partition table.

This tool is installed on the "preparation" network-booted OS. The current version is named Priprave 2026. Playbook status: TODO

Join the Linux prototype to AD

Since both Windows and Linux instances on any given classroom computers have the same IP address, We can't join both Windows and Linux of each computer to AD. We choose to have Windows systems joined to AD individually, while Linux systems all share the same machine account. Therefore, we join the Linux prototype to AD before deploying it to classrooms. The playbook for joining AD is join_ad.yml. Note that the same playbook works for both Windows and Linux, so make sure the VM is booted into the correct operating system.

ansible-playbook --user <local admin> -k -K -i inventory.yml join_ad.yml

Deploying to classrooms

The inventory file for all classroom computers is inventory-nb.yml. It pulls information about classroom computers from Netbox.

Deploy the images on an entire classroom

To deploy disk images to multiple classroom computers, we first need to boot all of them into the preparation OS. Then, we use the same FRI Backup tool from before to deploy the partition and/or any selection of partition images. Those partitions can then also expand to fill the entire disk. Playbook status: TODO

Another, more efficient way to perform a deployment to an entire classroom is to have one of the computers run as a multicast server (we use UDPCast). Then, the rest of the classroom can connect to that computer as multicast clients. This reduces network traffic from the SMB server to classrooms. Playbook status: TODO

Join Windows to AD

Joining a Windows system to AD is pretty much the same as joining the Linux prototype, except we use inventory-nb.yml as the inventory file, and we apply an extra filter to only apply to a classroom at a time.

ansible-playbook --user <local admin> -k -K -i inventory-nb.yml -l PR10-\* join_ad.yml

Updating Linux systems after they have been deployed

Sometimes, we want to update already-working Linux systems. For this task, we chose to use the snapshot feature of Btrfs. We use friclone for both making snapshots on the prototype, as well as applying them to classroom (and library) computers. Playbook status: TODO

How classroom computers are prepared at FRI

The computers are prepared as follows:

  • Teachers are asked to check their requirements.
  • Fix ansible scripts according to the requirements.
  • Set up a fresh Windows and Linux install on a VM, using files in unattended\_install.
  • Deploy the software with ansible, fixing fresh bugs due to updates and changes in the install processes along the way.
  • Fix root filesystem UUIDs to what they were last year so the network-booted menu still works without changes.
  • Create partition table image and partition images using FRI Backup.
  • Deploy the images on separate VMs - one for Linux, one for Windows.
  • Have teachers check their software in the VMs, report any problems.
  • Fix problems on the VMs.Potrjujem udeležbo za oba, ker si pojasnil, da gre za vrhunsko konferenco za vsebino, ki ju pokrivata sodelavca. Jure bo to delal v bližnji prihodnosti.
  • Create partition images for Windows on one VM, for Linux on the other.
  • Deploy the images on a limited number of computers in the classrooms using FRI Backup.
  • Test the newly deployed computers, fix identified problems on the VMs.
  • Join the Linux VM into AD. All Linux systems in classroom computers use the same AD account/machine password.
  • Deploy the partition tables and partitions to the classrooms using custom ansible scripts running FRI Backup and UDPCast.
  • Join Windows into AD.

The home directory problem

Some pieces of modern software assume that a computer is only used by one user who has practically unlimited space in their home folder. This obviously isn't great for classrooms where many different students use the same computer every day, and all of their home directories are stored on an SMB server. Examples of such software are Android Studio, Visual Studio Code, Matlab, Windows Subsystem for Linux (WSL) and others. Instead of trying to get the software to work, we might just give up and have everyone use the same account on each computer, then wipe all data after they log out / reboot. As of 2026, Windows profiles have been left to grow out of control, while Linux profiles are much more manageable due to our use of Btrfs (or rather, it's an extra reason to use it).

Linux

We use home_clone. When a user logs in, a certain user's home directory, asistent in our case, is btrfs snapshotted and mounted at the user's home directory location. References to the home directory, existing symbolic links etc. are fixed to reflect the new location. The home directory's data directories (like Documents, Videos, Pictures, etc.) are symbolic links into a subdirectories of a directory named home_share. That directory is renamed and the actual remote home directory of the user is linked to home_share instead. This has the effect of the user having access to their remote profile, while still having a non-broken experience, provided by a well-behaving snapshot.

Windows

We intend to use UWF. As of 2026, we aren't using this. Windows profiles are still large and are prone to breaking somewhat randomly. A self-service utility for resetting a user's home is being developed for this reason.