setup_custom role – Setup and customize lab’s computers
Note
This role is part of the ufrmath.computer_labs collection (version 1.0.0).
To install it use: ansible-galaxy collection install git+https://github.com/guillod/computer_labs.
To use it in a playbook, specify: ufrmath.computer_labs.setup_custom.
Entry point custom – Customize the computers
Synopsis
Switch to standard gdm theme;
Add SU logo to gdm login;
Add custom dconf values (favorite apps, colors, custom text in gdm login, logout on inactive, proxy settings);
Hack to propagate dconf proxy settings to environments variables;
Custom xdg directory (remove Pictures, Templates, Videos,…);
Remove popping-up applications (gnome initial setup, reports and Deja Dup, LTS new release);
Set admin user as system account (useful only when gdm list users);
Allow ssh login only from user admin;
Disable grub recovery and wayland;
Automatic power off on idle through logind;
Keep authenticated users for at least one year;
Entry point initial – Perform initial setup
Synopsis
Run on clean Ubuntu Desktop installation having
openssh-serverinstalled;On first run, might have to populate
ansible_ssh_passandansible_become_pass.On first run, wait for SSH to be ready and add SSH fingerprint to local
~/.ssh/known_hosts;Protect admin home and add SSH key
id_key.pubto the hosts;Configure sudo without password for user admin;
Define hostname as defined in Ansible hosts file.
Add ntp server from
ntp_server;Disable crash reports;
Configure firewall with ufw to disable all incoming except ssh;
Parameters
Parameter |
Comments |
|---|---|
ntp server Default: |
Entry point machine_id – Regenerate machine-id
Synopsis
Under some circumstances (custom ubuntu image, Debian preseed, same install time?), the machine-id for different machines are the same;
If
/etc/machine-idis not a link to/var/lib/dbus/machine-id: restore the link and regenerate machine-id withsystemd-machine-id-setup.
Entry point main – Setup and customize lab’s computers
Synopsis
Initial setup
Modify machine ID
Setup netplan
Reboot if required
Define proxy
Customize
Define custom repository
Parameters
Parameter |
Comments |
|---|---|
custom repository |
|
server ip to add to |
|
ntp server Default: |
Entry point netplan – Switch from NetworkManager to networkd
Synopsis
Switch using netplan from NetworkManager to networkd (using DHCP).
Add netplan to use networkd;
Remove default NetworkManager netplan;
Disable NetworkManager;
Apply new netplan.
Entry point proxy – Add proxy to environment variables and apt config
Synopsis
Add proxy to
/etc/environmentifproxy_envis defined;Add proxy for apt if
proxy_envis defined;
Entry point repository – Add custom repository to apt sources
Synopsis
Add
tp-serverto/etc/hostswith ipip_server;Setup custom apt repository with direct connection (no proxy).
Parameters
Parameter |
Comments |
|---|---|
custom repository |
|
server ip to add to |
Collection links
Repository (Sources) Administrator documentation User documentation