=========================== mortis.kamino Release Notes =========================== .. contents:: Topics v2.0.0 ====== Minor Changes ------------- - docker - ``docker_apt_arch`` now defaults to an empty value that derives the apt architecture from the host (``x86_64`` gives ``amd64``, ``aarch64`` gives ``arm64``) instead of always writing ``amd64``, so an arm64 host no longer needs an override. A value set in the inventory is used as before. A host with any other architecture fails the play with a message that names ``docker_apt_arch`` instead of getting an ``amd64`` source line that its apt cannot use; set ``docker_apt_arch`` for such a host. - fail2ban - the main entry point now reloads Fail2Ban when ``jail.local`` changes instead of restarting it, as ``service_jail`` already did. A restart stops every jail, which flushes its bans out of the firewall until they are restored from Fail2Ban's database, and forgets failures counted toward ``maxretry``; a reload applies the new settings to the running jails. The ``Restart Fail2Ban`` handler is removed: nothing in the role notifies it any more. - gitea_runner - The Docker prune can bound the image cache by count and by disk use. With ``gitea_runner_docker_prune_keep_per_repository`` above 0 the weekly prune keeps the newest N image IDs of each repository and removes every other image no container uses. With ``gitea_runner_docker_prune_disk_threshold_percent`` set, a timer (``gitea_runner_docker_prune_disk_check_schedule``, hourly by default) runs the count prune and a builder prune capped at ``gitea_runner_docker_prune_builder_keep_storage`` when the filesystem holding the Docker root is fuller than that, behind the same job gate as the weekly prune. Both are off by default. - system_baseline - Add ``system_baseline_unattended_upgrade_package_blacklist`` (list of regular expressions, default empty). A non-empty list is written to ``/etc/apt/apt.conf.d/90unattended-upgrades-blacklist`` as ``Unattended-Upgrade::Package-Blacklist``, so unattended-upgrades leaves those packages alone on a host whose kernel or drivers must not change. An empty list removes the file. - system_baseline - Add the input ``system_baseline_apt_daily_timeout``. When set (a systemd time span, for example ``1h``; the default is empty, which leaves the host alone) the role writes a ``TimeoutStartSec`` drop-in for ``apt-daily.service`` and reloads systemd, so a hung apt run is stopped. Tag ``apt-daily-timeout``. - system_baseline - Add the inputs ``system_baseline_reboot_throttle`` and ``system_baseline_reboot_post_delay`` (whole numbers, default ``0``, which keeps today's behaviour). They are passed to the ``throttle`` and ``post_reboot_delay`` of the reboot task, so a caller can reboot one host at a time and wait before the next. The main flow and the ``reboot`` entry point read them and refuse a negative or non-integer value before anything runs. - system_baseline - Add the profile key ``apt_upgrade`` (``safe`` or ``dist``) and the input ``system_baseline_apt_upgrade`` that it resolves to. The ``pve`` profile now upgrades packages with ``apt-get dist-upgrade`` (``apt full-upgrade``, which Proxmox VE documents), so packages that a plain upgrade holds back (a new kernel, ``pve-manager``) are installed too; the Ubuntu profiles keep the plain upgrade. A ``pve`` host therefore receives those packages on the next run: set ``system_baseline_reboot_if_required`` to ``false`` first if the role must not reboot it. The ``update`` entry point follows the input when ``system_baseline_system_type`` is set, and so can also remove packages on a ``pve`` host; it stays on the plain upgrade when the type is not set, and now refuses an unknown mode. Breaking Changes / Porting Guide -------------------------------- - Raise the minimum ansible-core to 2.22 (controller Python 3.14); 2.19, 2.20 and 2.21 are no longer supported. ``requires_ansible`` and every role's ``min_ansible_version`` now equal the ansible-core minor that CI tests. - gitea_runner - With ``gitea_runner_molecule_enabled`` the role no longer installs molecule tooling or collections: a job on the ``:host`` label brings its own toolchain in an image and runs it on the host's Docker daemon. The role still registers that label and now installs only ``git`` and ``python3`` on the host, which the job uses there, and no longer needs PyPI or Ansible Galaxy access. The inputs ``gitea_runner_molecule_venv``, ``gitea_runner_molecule_collections_path``, ``gitea_runner_collections_requirements_file``, ``gitea_runner_molecule_version``, ``gitea_runner_molecule_plugins_version``, ``gitea_runner_molecule_ansible_core_version`` and ``gitea_runner_molecule_docker_sdk_version`` are removed; a value set in the inventory is ignored. The role does not delete a venv or collections directory an earlier version installed: remove ``/opt/molecule-venv``, ``/opt/molecule-collections`` (the old defaults) and ``/molecule-requirements.yml`` by hand if nothing else uses them. Bugfixes -------- - system_baseline - Do not run the apt upgrade in check mode in the main flow. A package that is only waiting for the next patch run, or a package cache older than an hour, is not drift, but the package module reports both as changed, so a scheduled dry run flagged every host. Autoremove and autoclean are now a task of their own and stay checked; as part of the upgrade call the module did not reach autoclean, so ``apt-get autoclean`` now runs (and may report changed once on a host with stale archives), in the main flow and in the ``update`` entry point. The ``update`` entry point still previews the upgrade in check mode. v1.11.0 ======= Minor Changes ------------- - cloudflared - New role. Installs cloudflared as a systemd service for a locally managed Cloudflare Tunnel, with a sha256-verified binary, checks that the tunnel still exists, renders ``config.yml`` from ``cloudflared_ingress``, writes the tunnel credentials, and with ``cloudflared_manage_dns`` (default true) points a proxied CNAME for every ingress hostname at the tunnel, refusing to overwrite a record that does not point at a tunnel and pruning CNAMEs of this tunnel that are no longer listed. With ``cloudflared_update`` it downloads and verifies a new release before stopping anything and swaps it in through the internal ``_binary_update`` role, with rollback on failure. ``cloudflared_remove`` removes the daemon and ends the role; with ``cloudflared_remove_data`` it also deletes the tunnel and its records on Cloudflare. The opt-in ``mint`` entry point creates the tunnel with a secret generated in memory and registers its id and credentials as ``no_log`` facts for the calling play to persist; it is refused under CI and does nothing when a tunnel is already set. v1.10.2 ======= Bugfixes -------- - systemd_hardening - Disable and mask the socket of a listed service as well. A service whose socket stayed active was started again by the next connection to its port (``rpcbind`` listens on port 111 through ``rpcbind.socket``). Every name in the disable and mask lists is now looked up as a socket and as a service, with or without a ``.service`` or ``.socket`` suffix, and each installed unit is acted on, the socket first. A socket that belongs to a listed name, such as ``rpcbind.socket``, is now stopped and disabled, or masked, where before it was left alone. v1.10.1 ======= Bugfixes -------- - systemd_hardening - Look up the listed units with one ``systemctl show`` instead of listing every unit file. The listing can keep PID 1 busy for seconds on a host with slow storage, and the cost grows with the number of unit files. A unit is still skipped when it has no unit file. An instance name such as ``foo@bar.service`` is now matched when its template exists, and a template name such as ``foo@.service`` in the lists now makes the lookup fail instead of matching. v1.10.0 ======= Minor Changes ------------- - gitea_runner - New role. Installs a Gitea Actions runner (``gitea-runner``) with Docker as a systemd service, with a sha256-verified binary, registers it with a token minted on a Gitea host (optionally scoped to an owner or repository), renders ``config.yaml``, and optionally schedules a weekly Docker prune that skips while a job runs, installs pinned molecule test tooling behind a host-executor label, and removes the runner on request. With ``gitea_runner_update`` it downloads and verifies a new release before stopping anything and swaps it in through the internal ``_binary_update`` role, with rollback on failure. A forced re-registration mints the new token before it touches the current registration and is refused under CI. v1.9.0 ====== Release Summary --------------- Adds the gitea role, the second role of wave 2 and the second caller of the internal _binary_update role. Existing roles are unchanged. Minor Changes ------------- - gitea - New role. Installs the Gitea git service as a systemd binary with a GPG-verified release (pinned signing key, throwaway keyring), renders ``app.ini`` (SQLite, loopback listener, registration disabled, optional mailer), creates the admin user and adds SSH keys through the API, opens its port through ``mortis.kamino.ufw``, deploys a Fail2Ban jail through ``mortis.kamino.fail2ban``, and removes it on request. With ``gitea_update`` it downloads and verifies a new release before stopping anything and swaps it in with rollback on failure. A separate ``mint`` entry point creates the admin API token on explicit request only. v1.8.0 ====== Release Summary --------------- Adds the traefik role, the first role of wave 2, and the internal _binary_update role it uses to swap in a new release with rollback (internal: not part of the public API). The trivial README and comment fixes of the wave 1 scrub ship here too. Existing roles are unchanged. Minor Changes ------------- - traefik - New role. Installs the Traefik reverse proxy as a systemd binary with a checksum-verified release, renders its static and dynamic configuration with Cloudflare DNS-challenge certificates and an optional dashboard behind basicAuth, opens its ports through ``mortis.kamino.ufw``, and removes it on request. With ``traefik_update`` it downloads and verifies a new release before stopping anything and swaps it in with rollback on failure. v1.7.0 ====== Release Summary --------------- Adds the user_management role, which completes wave 1. Its root fallback refuses to run when the primary user's name is not ansible_user. Existing roles are unchanged. Minor Changes ------------- - user_management - New role. Manages the primary ansible user and additional users (a user with ``state=absent`` is removed), their ``authorized_keys`` (exclusive by default), sudo and cloud-init. When the configured user cannot connect (a fresh guest) it falls back to root with the same deploy key, never a password, and hands the connection back to the configured user once it exists; the fallback refuses to run when the primary user's name is not ``ansible_user``. The optional ``user_management_lock_root_password`` (default false) replaces root's password hash with ``!`` and leaves root's keys and shell alone. v1.6.0 ====== Release Summary --------------- Adds the sshd role. ufw base rules can now delete a rule, so an open rule can be replaced by narrower ones, and fail2ban gains fail2ban_ignoreip. Existing behaviour is unchanged unless the new options are used. Minor Changes ------------- - fail2ban - add ``fail2ban_ignoreip``, written as ``ignoreip`` in the ``[DEFAULT]`` section of ``jail.local`` so it applies to every jail, the service jails included. The default is Fail2Ban's own (``127.0.0.1/8`` and ``::1``). The first run after upgrading adds the section and restarts Fail2Ban once. - sshd - New role. Writes a hardened sshd drop-in selected by a profile (``pve``, ``ubuntu_lxc``, ``ubuntu_vm``), merged from a baseline, the profile and ``sshd_settings``, checked with ``sshd -t`` and reloaded through a handler. It refuses to run when the result would lock SSH out (password login off without public key login), when the ``pve`` profile does not allow root public-key login or lacks ``rsa-sha2-512`` (Proxmox VE cluster SSH needs both), and when any profile allows SHA-1 ``ssh-rsa``. - ufw - ``ufw_rules`` entries accept ``delete`` (a boolean). An entry with ``delete: true`` removes the rule it describes, so a base rule can be replaced, for example an open SSH rule by narrower ones. Deletes are applied after every other rule of the list, a delete entry never satisfies the SSH lock-out guard, and a rule that the list both adds and deletes fails the play. ``service_rules`` does not accept the key. v1.5.0 ====== Release Summary --------------- system_baseline gains an optional tmux session on SSH login, a toggle to skip the package update in the main flow, and pinned unattended-upgrades origins for the pve profile. No new roles. Minor Changes ------------- - system_baseline - add ``system_baseline_update`` (default ``true``). With ``false`` the main flow skips the package update, for hosts patched by a separate flow. The ``update`` entry point does not read it. - system_baseline - add an optional tmux session on SSH login for the ``ubuntu_lxc`` and ``ubuntu_vm`` profiles (``system_baseline_tmux_autostart``, ``system_baseline_tmux_session``, ``system_baseline_tmux_windows``). It is off by default. The two profiles now install ``tmux``. - system_baseline - add the profile key ``unattended_upgrade_origins`` (resolved as ``system_baseline_unattended_upgrade_origins``). A non-empty list is written to ``/etc/apt/apt.conf.d/90unattended-upgrades-origins``, which clears the earlier ``Allowed-Origins`` and ``Origins-Pattern`` lists and allows only the listed patterns. The ``pve`` profile now pins Debian's point-release and security origins, so the Proxmox repository is never upgraded unattended and a future Debian default cannot widen the set. On ``pve`` hosts this also removes any origin an operator added in ``50unattended-upgrades`` or another earlier ``apt.conf.d`` file (``Allowed-Origins`` included). To keep them, opt out with ``system_baseline_profile_overrides: {pve: {unattended_upgrade_origins: []}}`` or set ``system_baseline_unattended_upgrade_origins: []``; the role then removes the drop-in. The ``ubuntu_lxc`` and ``ubuntu_vm`` profiles pin nothing and are unchanged. v1.4.0 ====== Release Summary --------------- Adds the ufw role (entry points main, service_rules and orphan_rules), copied from the environment repository's role with unchanged behaviour. Existing roles are unchanged. Minor Changes ------------- - ufw - New role. Installs and enables UFW with default policies, base rules, ``before.rules`` and sysctl overrides, and refuses to run when the rules would lock the host out of SSH. Besides ``main``, the ``service_rules`` entry point applies a service role's own rules tagged with its name, and the ``orphan_rules`` entry point reports, and optionally deletes, the tagged rules of owners that are no longer managed. v1.3.0 ====== Release Summary --------------- Adds the system_baseline role, the first role that needs other collections; community.general and ansible.posix are now declared dependencies. Minor Changes ------------- - galaxy.yml - Declare ``community.general`` (>=14.0.0) and ``ansible.posix`` (>=2.2.0) as dependencies, needed by ``system_baseline``. ``ansible-galaxy`` now installs them with the Collection unless the consumer's requirements already pin a satisfying version. - system_baseline - New role. Applies a per-system-type OS baseline (apt upgrade, package install and removal, unattended-upgrades, locale, timezone, journal size cap, sysctl hardening, tmpfs mounts and an optional reboot). Besides ``main``, the ``update`` and ``reboot`` task files are supported entry points for callers that drive their own reboot; ``reboot`` sets the ``system_baseline_reboot_required`` fact. v1.2.0 ====== Minor Changes ------------- - network_interfaces - New role. Renders /etc/network/interfaces from a layout of manual interfaces and bridges, validates it with ifreload and restores the backup if validation fails. - systemd_hardening - New role. Disables and masks risky services per system type, writes a systemd manager hardening drop-in and renders opt-in per-service sandboxing drop-ins. v1.1.0 ====== Minor Changes ------------- - fail2ban - New role. Installs Fail2Ban, manages jail.local and the service, deploys per-service jails into jail.d. v1.0.0 ====== Release Summary --------------- First release. It holds the docker role; further roles follow in waves. Minor Changes ------------- - The Collection archive no longer contains extensions/ (the image-smoke molecule scenario), the roles' molecule scenarios, CLAUDE.md or other repository tooling; the Build workflow now fails when the archive holds anything outside an allow list, a member that is not a regular file or directory (symlinks, hardlinks, devices), or a path that is absolute or holds an empty, '..' or '.git' component (compared case-insensitively), a backslash or a control or zero-width character; it also fails on duplicate members, an empty archive or one that lacks MANIFEST.json, FILES.json, COPYING, README.md, meta/runtime.yml or changelogs/changelog.yaml, and on symlinks in the source tree (which ansible-galaxy would dereference). - The archive check also rejects any file name containing "vault", SSH key and .envrc/.env* files, names that Windows or macOS extraction would read differently (trailing space or dot, reserved device names such as CON or NUL, "::", 8.3 aliases of .git, non-ASCII spaces, surrogate, private-use and unassigned characters, components over 255 bytes), case-insensitive duplicates and a name used as both a file and a directory. The Build workflow fails with a clear message unless exactly one tarball was built. - docker - New role. Installs, updates or removes Docker Engine from the upstream APT repository and adds users to the docker group.