Swaps a staged, verified binary into place for a systemd service: refuse when nothing executable is staged, then reload, stop and wait, back up the live binary, rename the staged file over it, start and wait for active, and compare the reported version. A failure after the stop restores this run's backup, starts the service again and fails with a message that says whether the restore and the restart worked. Under --check the waits and the version check are skipped, so a preview against a stopped service does not fall into the rollback. The staged file is removed in every case. The role is internal (ADR 0004 in the environment repository): called only by roles of this Collection by FQCN, outside the public API, marked by the underscore, [INTERNAL] in its meta and argument_specs, and a first task that refuses a call without a parent role. traefik is its first caller and arrives in the same release. Two molecule scenarios use stub binaries under a stub unit, without network: default (successful bump and idempotence, a binary that cannot start, a binary that reports the wrong version, nothing staged, a direct call, a first install) and check_mode (the bump under molecule check against a stopped service changes nothing). Lint: role-name is skipped (its regex rejects the leading underscore, as for prometheus.prometheus roles/_common), meta has no role_name (schema[meta] uses the same regex and cannot be skipped), and .ansible-lint-ignore lists the role's own files for var-naming[no-role-prefix], which strips the underscore from the variable but not from the role name and so cannot pass. The ignore file is kept out of the Collection build and is on the scenario picker's IGNORED list. The README Roadmap no longer lists the role. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
66 lines
2.4 KiB
Markdown
66 lines
2.4 KiB
Markdown
# mortis.kamino
|
|
|
|
An Ansible Collection of reusable, hardened roles for a self-hosted home lab:
|
|
Linux baseline, firewall, SSH, user management and, in later releases, Proxmox,
|
|
Gitea and Gitea Actions runner roles.
|
|
|
|
Status: roles arrive in waves. Release 1.7.0 holds the `docker`, `fail2ban`, `network_interfaces`, `sshd`, `system_baseline`, `systemd_hardening`, `ufw` and `user_management` roles.
|
|
|
|
## Consuming
|
|
|
|
The Collection is consumed by git tag and used by fully qualified collection
|
|
name (FQCN) only, `mortis.kamino.<role>`:
|
|
|
|
```yaml
|
|
# requirements.yml
|
|
collections:
|
|
- name: https://git.rkdr.net/mortis/kamino.git
|
|
type: git
|
|
version: v1.7.0
|
|
```
|
|
|
|
Its dependencies (`community.general`, `ansible.posix`) are declared in `galaxy.yml`, so
|
|
`ansible-galaxy` installs them unless the same file already pins a satisfying version.
|
|
|
|
```yaml
|
|
- ansible.builtin.include_role:
|
|
name: mortis.kamino.<role>
|
|
```
|
|
|
|
Pin a tag, never a branch. Releases are annotated `vX.Y.Z` tags pushed by the
|
|
maintainer; the tag equals `v` plus the `version` in `galaxy.yml`. Every role
|
|
input carries the role name as a prefix (`<role>_<name>`).
|
|
|
|
## Roadmap
|
|
|
|
Roles are extracted from the author's private environment repository in waves
|
|
(tracked in that repository's epic #486 and its ADR 0001). The order inside a wave is
|
|
not a promise, and a role arrives only when its own gates (tests, a safe cutover of
|
|
the environment that uses it) are met.
|
|
|
|
Still to come:
|
|
|
|
- Wave 2: `pve_vm`, `pve_lxc`, `traefik`, `gitea`, `gitea_runner`, `tailscale`,
|
|
`cloudflared`, `pihole`.
|
|
- Wave 3: `rke2`, `proxmox_host`.
|
|
- Later, wave not yet assigned: `opnsense`, `proxmox_firewall`.
|
|
|
|
Will not be extracted (they serve one lab or install that lab's own tool pins):
|
|
`k8s_manage`, `k8s_localhost`, `k8s_lint_tools`, `minecraft_server`, `dragonwilds_server`,
|
|
`satisfactory_server`.
|
|
|
|
## Licence
|
|
|
|
Licensed GPL-3.0-or-later (see `COPYING`). Files marked GPL-3.0-only
|
|
(roles/pihole, roles/ufw/templates/before.rules.j2) make the Collection as a
|
|
whole distributable under GPL-3.0 only. Third-party material
|
|
keeps its own licence, marked by an SPDX header, with texts in `LICENSES/` and
|
|
attribution in `NOTICE`. The repository follows the REUSE specification
|
|
(`reuse lint`).
|
|
|
|
## Development
|
|
|
|
See `CONTRIBUTING.md`. Releases follow semantic versioning: annotated `vX.Y.Z`
|
|
tags that only the maintainer can push, a changelog built from antsibull-changelog
|
|
fragments, and consumption by pinned git tag and FQCN.
|