PyPI package (Ansible)
ragleap-ansible
version — loading live from PyPI…
Ansible roles that prepare and harden a fresh Ubuntu server: user, sudo, updates, SSH and firewall. Versions 0.1.0 to 0.1.2 cover the server base only; they do not install k3s, Helm or the charts yet.
pip install ragleap-ansible
Highlights
ragleap_base: packages, a deploy user with key-only login, passwordless sudo and unattended-upgrades. Tested in a throwaway Ubuntu 22.04 container, run twice, and the second run changes nothing. Since 0.1.2 its README also records two runs on GitHub-hosted Ubuntu 22.04 and 24.04 runners in CI, with the second run changing nothing; unattended upgrades actually running was not tested- Opt-in SSH hardening (
ragleap_base_harden_ssh): effective settings checked withsshd -T, idempotent, a bad configuration is rolled back. In a container and, since 0.1.2, on GitHub-hosted Ubuntu 22.04 and 24.04 runners: the running sshd offeredpublickey,passwordbefore hardening and onlypublickeyafter, and a key login as the deploy user still worked (updated 2026-10-30: this line said “a real key login against a running sshd was not tested”) - Opt-in firewall (
ragleap_base_enable_firewall): rules and defaults checked in a container, idempotent, and the sshd port is always opened. Since 0.1.2, on GitHub-hosted Ubuntu 22.04 and 24.04 runners the role ran twice with the second run changing nothing,ufwwas active with deny-incoming and allow-outgoing and ports 22 and 8082 open, and a port that was not opened was blocked from a container on the Docker bridge (updated 2026-10-30: this line said “ufw enableand real enforcement were not tested”). Not tested: reboot persistence, IPv6 rules, Docker published ports, SSH hardening together with the firewall, any host that is not a GitHub-hosted runner - New in 0.1.2: the firewall role no longer fails on Ubuntu 24.04 when
/run/sshddoes not exist yet (a host where SSH hardening had not run); it now creates the directory before it reads the effective sshd configuration - Known limits: Ubuntu 22.04 is the target and the real-host runs also covered 24.04, both on GitHub-hosted runners (disposable VMs; the CPU architecture was not recorded and no other host has been tried; updated 2026-10-30: this line said “Ubuntu 22.04 on x86_64 only”); Helm, k3s and installing the charts are not implemented yet; a container cannot run systemd, sshd or a firewall
Quickstart
cp inventory.example.ini inventory.ini # then list your server under [ragleap_servers] echo 'ragleap_base_deploy_ssh_public_key: "ssh-ed25519 AAAA... you@host"' > vars.yml ansible-playbook -i inventory.ini playbooks/bootstrap.yml -e @vars.yml
SSH hardening is off by default, because a mistake can lock you out of the server. Keep one session open while you run it. Pass the key through a vars file or JSON: a plain -e name=value splits at spaces and would cut the key short.