fix(system_baseline): declare dependencies and correct the review findings
- galaxy.yml declares community.general and ansible.posix: system_baseline is the first role that calls modules outside ansible.builtin, and a consumer that installs only this Collection failed to parse the play. - The README override example set Automatic-Reboot to false, which every profile already defaults to; it now shows the opt-in. - Comment and description wording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
5abd1abe73
commit
9c705a7f93
6 files changed
+16
-6
No files matched your search
@@ -19,6 +19,9 @@ collections:
|
||||
version: v1.2.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>
|
||||
|
||||
@@ -4,3 +4,6 @@ minor_changes:
|
||||
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.
|
||||
- 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.
|
||||
+5
-1
@@ -17,7 +17,11 @@ repository: https://git.rkdr.net/mortis/kamino
|
||||
documentation: https://git.rkdr.net/mortis/kamino/src/branch/main/README.md
|
||||
homepage: https://git.rkdr.net/mortis/kamino
|
||||
issues: https://git.rkdr.net/mortis/kamino/issues
|
||||
dependencies: {}
|
||||
# Lower bounds are the versions CI tests against; no upper bound, so a consumer's
|
||||
# newer pin does not conflict. Used by system_baseline.
|
||||
dependencies:
|
||||
community.general: ">=14.0.0"
|
||||
ansible.posix: ">=2.2.0"
|
||||
build_ignore:
|
||||
# Repository tooling that is not part of the Collection. scripts/check_tarball.py fails
|
||||
# the build if anything outside its allowlist ends up in the archive, so a new top-level
|
||||
|
||||
@@ -40,13 +40,13 @@ templating error instead of the role's own message.
|
||||
| `system_baseline_locale` | `en_US.UTF-8` | no | Locale |
|
||||
| `system_baseline_reboot_if_required` | `true` | no | Reboot when `/var/run/reboot-required` exists |
|
||||
|
||||
A flat `system_baseline_*` input replaces that value entirely. To change one key of a profile dict, use `system_baseline_profile_overrides`, for example to keep unattended-upgrades from rebooting a group:
|
||||
A flat `system_baseline_*` input replaces that value entirely. To change one key of a profile dict, use `system_baseline_profile_overrides`, for example to let unattended-upgrades reboot a group on its own:
|
||||
|
||||
```yaml
|
||||
system_baseline_profile_overrides:
|
||||
ubuntu_vm:
|
||||
unattended_upgrade_settings:
|
||||
"Unattended-Upgrade::Automatic-Reboot": false
|
||||
"Unattended-Upgrade::Automatic-Reboot": true
|
||||
```
|
||||
|
||||
## Entry points
|
||||
@@ -95,7 +95,7 @@ Besides `main`, two task files are a supported interface, for a caller that driv
|
||||
## Notes
|
||||
|
||||
- The `pve` profile has no `ufw`; the `ubuntu_*` profiles install it and `fail2ban`.
|
||||
- The `ubuntu_vm` profile does not let unattended-upgrades reboot on its own (`Automatic-Reboot: false`); a host opts in through `system_baseline_profile_overrides`.
|
||||
- No profile lets unattended-upgrades reboot on its own (`Automatic-Reboot: false`); a host opts in through `system_baseline_profile_overrides`.
|
||||
- Set `system_baseline_reboot_if_required: false` for hosts whose reboot takes other machines down (hypervisors) or needs a drain first (cluster nodes).
|
||||
- Molecule skips `sysctl`, `secure_tmp`, `update` and `timezone` (no privileged container); see `molecule/default/molecule.yml`.
|
||||
- Policy lives in defaults, not `vars/`, so group_vars and host_vars can override it.
|
||||
|
||||
@@ -4,7 +4,7 @@ galaxy_info:
|
||||
namespace: mortis
|
||||
author: Defame1297
|
||||
license: GPL-3.0-or-later
|
||||
description: "Per-system-type OS baseline: apt upgrade, packages, unattended-upgrades, locale, timezone, sysctl, tmpfs mounts, reboot."
|
||||
description: "Per-system-type OS baseline: apt upgrade, packages, unattended-upgrades, locale, timezone, journal cap, sysctl, tmpfs mounts, reboot."
|
||||
min_ansible_version: "2.19"
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
- system_baseline_sysctl_hardening | selectattr('name', 'equalto', 'net.ipv4.conf.all.log_martians') | list | length == 1
|
||||
quiet: true
|
||||
|
||||
# Play vars sit below the old include_vars, so these overrides were silently ignored before.
|
||||
# Consumer play vars override the profile.
|
||||
- name: Consumer overrides win over the profile
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
|
||||
Reference in new issue
Block a user