Per the docs (see also here and here), Cockpit can be scaled dramatically using ansible.
Not gonna detail all the things, but essentially setting up a temporary hosts
group of n
servers like
# hosts
[temp]
10.13.37.100
10.13.37.101
10.13.37.102
10.13.37.103
10.13.37.104
[all:vars]
ansible_become_method=sudo
ansible_become_user=root
ansible_python_interpreter=/usr/bin/python3
ansible_async_dir=/tmp/.ansible_async
[temp:vars]
ansible_user=<sudoer>
then running
ansible-playbook -i hosts tasks/cockpit.yml -b -K --limit 'temp' -v
against a directory structure like
.
├── cockpit.yml
├── templates
│ ├── 01-machines.json.j2
│ └── cockpit.conf.j2
will dynamically generate a 01-machines.json
file based on your hosts
inventory while excluding IP address ranges.
It also creates the cockpit.conf
with multiple hosts enabled, disabled login on the home page (no traversing connected servers), limited ssh sessions, and idle timeout set.
With a little more elbow grease, installing ssl certs would be fairly trivial as well as placing each server behind a reverse proxy.
It's also idempotent and will only update configs and restart the cockpit service when they change 🎉