converge, base_system, and machine_manager

This describes the software I wrote for configuration-managing Debian machines before I had the sense to use NixOS, which includes configuration management as part of the operating system.

converge

converge is the library that implements the units used to configure machines.

base_system

base_system is an opinionated base setup for Linux machines. It runs its own units along with units from every role that is tagged for the machine (see the machine_manager section). base_system does:

machine_manager

machine_manager puts everything together: it is the end-user tool for managing many machines in parallel. machine_manager:

Workflow for adding a role to a machine

# mm ls bhsvps1
HOSTNAME  PUBLIC IP     WIREGUARD  SSH  TAGS                                                                                      RAM   CPU              CO  TH  PROBE TIME            BOOT TIME             TIME OFFSET   KERNEL              PENDING UPGRADES
bhsvps1   129.5.144.68  10.10.0.9  22   boot:mbr country:ca release:stretch role:custom_packages role:ext4 role:ovh_vps role:znc  1952  Mystery Haswell  1   1   2018-01-12T23:35:20Z  2018-01-05T17:42:47Z  +0.000000295  4.14.0-27-amd64 #1
# mm tag bhsvps1 role:ebook_converter
# mm configure bhsvps1
# Waiting on: bhsvps1
# Waiting on: bhsvps1
bhsvps1          configured

Workflow for upgrading packages on many machines

# mm probe '.*'
# Waiting on: bhsvps1 do8 ksca2 paris2 sbuild-stretch
sbuild-stretch   probed
# Waiting on: bhsvps1 do8 ksca2 paris2
ksca2            probed
# Waiting on: bhsvps1 do8 paris2
paris2           probed
# Waiting on: bhsvps1 do8
do8              probed
# Waiting on: bhsvps1
bhsvps1          probed
# mm ls -c hostname -c last_probe_time -c time_offset -c kernel -c pending_upgrades
HOSTNAME        PROBE TIME            TIME OFFSET   KERNEL              PENDING UPGRADES
bhsvps1         2018-01-11T17:14:46Z  +0.000000312  4.14.0-27-amd64 #1
do8             2018-01-11T17:14:31Z  -0.000000034  4.14.0-29-amd64 #1  nodejs=8.9.4-1nodesource1
ksca2           2018-01-11T17:14:06Z  -0.000000208  4.14.0-29-amd64 #1  nodejs=8.9.4-1nodesource1
paris2          2018-01-11T17:14:18Z  +0.000000122  4.14.0-27-amd64 #1  nodejs=8.9.4-1nodesource1
sbuild-stretch  2018-01-11T17:13:54Z  +0.000000024  4.14.0-29-amd64 #1
# mm upgrade '.*'
bhsvps1          had no pending upgrades in database; probe again if needed
sbuild-stretch   had no pending upgrades in database; probe again if needed
# Waiting on: do8 ksca2 paris2
paris2           upgraded
# Waiting on: do8 ksca2
ksca2            upgraded
# Waiting on: do8
do8              upgraded
# mm ls -c hostname -c last_probe_time -c time_offset -c kernel -c pending_upgrades
HOSTNAME        PROBE TIME            TIME OFFSET   KERNEL              PENDING UPGRADES
bhsvps1         2018-01-12T23:13:45Z  +0.000000299  4.14.0-27-amd64 #1
do8             2018-01-12T23:16:50Z  -0.000000059  4.14.0-29-amd64 #1
ksca2           2018-01-12T23:16:37Z  -0.000000196  4.14.0-29-amd64 #1
paris2          2018-01-12T23:16:01Z  +0.000000093  4.14.0-27-amd64 #1
sbuild-stretch  2018-01-12T23:12:51Z  +0.000000054  4.14.0-29-amd64 #1

Sample roles

role_custom_packagesadditional apt source for installing custom packages
role_custom_packages_serverhosts custom packages using self-contained nginx and spiped
role_sbuildsbuild host for building Debian packages
role_desktopworking xfce4 desktop environment
role_autologinautomatically log into xfce4 on boot
role_lxc_hostLXC host machine
role_nvidiaworking NVIDIA setup on either Debian or Ubuntu
role_apc_upsAPC UPS battery setup

Sample code (role_autologin)