This is the multi-page printable view of this section. Click here to print.
Roles
- 1: Adguard
- 1.1: Defaults
- 2: Caddy
- 2.1: Defaults
- 3: CIFS
- 3.1: Defaults
- 4: ClamAV scan
- 4.1: Defaults
- 5: ComfyUI tools role
- 5.1: Defaults
- 6: Consul
- 6.1: Defaults
- 7: Consul
- 7.1: Defaults
- 8: Consul envoy
- 8.1: Defaults
- 9: Dev VM
- 9.1: Defaults
- 10: DNS
- 10.1: Defaults
- 11: Docker
- 11.1: Defaults
- 12: Download host
- 12.1: Defaults
- 13: Facts
- 13.1: Defaults
- 14: Filesystem
- 14.1: Defaults
- 15: Firewall
- 15.1: Defaults
- 16: Forgejo
- 16.1: Defaults
- 17: Forgejo
- 17.1: Defaults
- 18: Forgejo runner
- 18.1: Defaults
- 19: Gpg
- 19.1: Defaults
- 20: Grafana role
- 20.1: Defaults
- 21: Harboer
- 21.1: Defaults
- 22: Hermes
- 22.1: Defaults
- 23: Hiddify manager
- 23.1: Defaults
- 24: Hiddify manager with host
- 24.1: Defaults
- 25: Host
- 25.1: Defaults
- 26: Install CA
- 26.1: Defaults
- 27: K3s
- 27.1: Defaults
- 28: K3s bootstrap
- 28.1: Defaults
- 29: K3s cluster
- 29.1: Defaults
- 30: K3s kubeconfig
- 30.1: Defaults
- 31: llama.cpp
- 31.1: Defaults
- 32: lvg
- 32.1: Defaults
- 33: lvol
- 33.1: Defaults
- 34: Lynis audit
- 34.1: Defaults
- 35: MLflow
- 35.1: Defaults
- 36: Mount
- 36.1: Defaults
- 37: Nginx
- 37.1: Defaults
- 38: OpenCanary role
- 38.1: Defaults
- 39: Opencode
- 39.1: Defaults
- 40: OpenHands automation
- 40.1: Defaults
- 41: OpenHands canvas
- 41.1: Defaults
- 42: Openhands server
- 42.1: Defaults
- 43: OS
- 43.1: Defaults
- 44: Posgresql
- 44.1: Defaults
- 45: Pve
- 45.1: Defaults
- 46: PVE cluster
- 46.1: Defaults
- 47: PVE VM
- 47.1: Defaults
- 48: PVE VM remove
- 48.1: Defaults
- 49: Raspberry pi
- 49.1: Defaults
- 50: Socket proxy
- 50.1: Defaults
- 51: SSH
- 51.1: Defaults
- 52: SSH port forwarding
- 52.1: Defaults
- 53: SSH update known hosts
- 53.1: Defaults
- 54: T3 Code
- 54.1: Defaults
- 55: Traefik
- 55.1: Defaults
- 56: Traefik (old)
- 56.1: Defaults
- 57: Update all packages
- 57.1: Defaults
- 58: Users
- 58.1: Defaults
- 59: Vault
- 59.1: Defaults
- 60: Vault server certificate
- 60.1: Defaults
- 61: VictoriaMetrics role
- 61.1: Defaults
- 62: Wireguard
- 62.1: Defaults
- 63: Xray
- 63.1: Defaults
1 - Adguard
1.1 - Defaults
adguard_dir: /etc/adguard
adguard_work_dir: "{{ adguard_dir }}"
adguard_gpg_key_url: https://keys.openpgp.org/vks/v1/by-fingerprint/28645AC9776EC4C00BCE2AFC0FE641E7235E2EC6
adguard_gpg_key_src: files/key.asc
adguard_gpg_key_path: "{{ adguard_dir }}/release-key.asc"
adguard_gpg_key_checksum: "22d78dbacb461667861ee7d2dd13d13240ee003d"
adguard_release_source_url: https://github.com/AdguardTeam/AdGuardHome/releases/download
adguard_release_version: v0.107.48
adguard_release_checksum: "sha512:c0a336212e3792ae6fc6b8de976befce0038c5d6ddde919a00994c43a929349958c7bd65f7fb7fdd471962afa20855ecbf5830cc7a1d26f3037a716db638c101"
adguard_release_distrib: AdGuardHome_linux_amd64.tar.gz
adguard_release_url: "{{ adguard_release_source_url }}/{{ adguard_release_version }}/{{ adguard_release_distrib }}"
adguard_release_archive_dest: "{{ adguard_dir }}/release-{{ adguard_release_version }}-{{ adguard_release_distrib }}"
adguard_release_dest: "{{ adguard_dir }}/release-{{ adguard_release_version }}"
adguard_release_dir: "{{ adguard_release_dest }}/AdGuardHome"
adguard_release_bin: "{{ adguard_release_dir }}/AdGuardHome"
adguard_release_sig: "{{ adguard_release_bin }}.sig"
2 - Caddy
2.1 - Defaults
caddy_enabled: false
caddy_user: caddy
caddy_config_path: /etc/caddy/Caddyfile
caddy_config_dir: /etc/caddy/configs
caddy_config: |
import {{ caddy_config_dir }}/*
3 - CIFS
3.1 - Defaults
cifs_enabled: false
cifs_systemd_dir: /etc/systemd/system
cifs_mounts: []
4 - ClamAV scan
alwaldend.main.clamav_scan unpacks the official pinned ClamAV payload into
private endpoint scratch and runs native clamdscan --stream. The caller owns
the controller daemon, fresh signatures, parser settings, and its lifecycle.
The role installs no host package, service, schedule, or persistent SSH
configuration. It does not reboot, quarantine, delete scanned files, or expose
TCP. Check mode is unsupported.
Supply clamav_scan_archive as the controller path to
//third_party/com_github_cisco_talos_clamav:payload_tar, the compressed DEB data
payload containing usr/local. Endpoints need Linux x86_64, compatible glibc,
tar, GNU timeout, nice, ionice, root escalation, and Ansible’s existing Python
runtime. Failed or unreachable extraction stops preparation before the native
execution preflight; both results are retained privately. A failed preflight
does not by itself identify an architecture or library mismatch. Older XCP-ng
compatibility is deferred; there is no custom scanner or compatibility fallback.
Supply clamav_scan_socket as an existing absolute controller Unix socket and
clamav_scan_report_directory as an existing absolute controller-owned 0700
directory under ignored task scratch. Socket paths use ASCII letters, digits,
underscores, dots, slashes, and hyphens. IPC sockets use the controller’s native
XDG_RUNTIME_DIR, required to be operator-owned mode 0700. Each SSH master
gets its own temporary subdirectory there, independent of the daemon’s runtime
directory so daemon failure cannot remove a connection needed for recovery.
The absolute control path is limited to 90 bytes, reserving OpenSSH’s temporary
suffix. Report and scan paths must not contain #.
Remote runs allocate the dedicated ControlPath entirely on the controller and
establish a persistent SSH master before any endpoint command, including boot
identity, tempfile creation, and Ansible module bootstrap. Caller arguments are
captured once before overrides; the master preserves injected authentication,
host aliases, and caller options. Endpoint operations then create a
connection-user-owned 0700 Unix transport directory and separate root-owned
0700 scan scratch. Transport-directory creation and removal set
the task variable ansible_become: false so inventory escalation cannot change
their owner; scanner tasks retain root escalation. Explicit mux operations target only this master to attach
one reverse Unix forward, cancel it, and exit the master. No
meta: reset_connection is used. Local runs use the direct controller socket.
Native --ping=1:1 is a connectivity preflight: ClamAV 1.5.4 prints PONG after
connect/send without reading a daemon reply. Actual scan fixtures establish
that the daemon processes requests.
The native configuration disables file and directory symlink following, limits
recursion to 1000, and excludes /proc, /sys, role scratch, and
clamav_scan_exclude_paths with escaped, anchored subtree expressions. It does
not exclude all of /dev. Ansible inspects metadata beneath /dev without
following symlinks or opening file contents, and excludes the actual block and
character device nodes. Incomplete discovery prevents scanning. Their paths and
discovery failures are retained in the receipt; regular files under /dev/shm
remain eligible. Roots default to [/].
The caller’s daemon must use StreamMaxLength 104857601,
MaxFileSize 104857600, HeuristicAlerts yes, and AlertExceedsMax yes.
clamav_scan_max_file_bytes stays fixed at 104857600; the unchanged client
max_file_bytes + 1 expression produces a stream limit of 104857601, equal to
the controller stream limit. This lets the extra byte reach the engine, where
the lower file limit reports Heuristics.Limits.Exceeded.MaxFileSize FOUND.
Native traversal continues to later files without a successful truncated-prefix
verdict. All four controller settings are required; the role cannot attest
caller-owned daemon configuration.
Scanning uses timeout --signal=TERM --kill-after=15s, nice -n 19, and
ionice -c 3 by default. Set clamav_scan_background: false for Nice 0 and
best-effort I/O priority 4. Set clamav_scan_multiscan: true to pipeline native
streams for concurrent processing by the controller workers. It remains one
uploader; increasing daemon workers alone does not parallelize sequential
submission. Both controls are booleans recorded in the private receipt, and
neither changes coverage or parser limits. The deadline defaults to 86400 seconds, bounded to seven days;
Ansible async allows 60 seconds of additional supervision and polls every
15 seconds. Bundled library/certificate paths are explicit. The role takes the
native return code from a finished Ansible async result; missing, unreachable,
or unfinished results cannot supply a scanner status. Async polling returns
the result as data independently of the polling process exit. Synchronous
runtime/connectivity preflights retain their password-transport status wrappers.
Timeout remains incomplete.
Native exit 0 reports no detection, 1 reports detections, and 2 reports an
operational error. Exit 1 can mask errors, so the role also reads the final
summary’s Infected files and Total errors. Those counters do not account
for every session failure: the role also checks the entire
retained console for native ERROR: diagnostics and file-error records before
accepting completion. The check’s result is retained; failure to read the log
or an error diagnostic keeps the receipt incomplete. The native infected count
includes limits and encrypted-content heuristics; it is not a malware-only
count. The role does not parse every filename or invent a scanned-file count.
In ClamAV 1.5.4, a multiscan detection can also mask a silent session failure.
Consequently, multiscan exit 1 retains findings and terminal status but sets
native_completion_uncertain: true and complete: false, even if no errors
are printed. This conservative outcome includes heuristic-only detections;
it does not classify them as malware. Sequential scans retain their existing
completion rules, and multiscan exit 0 still requires the other checks.
Raw 0600 console.log, clamav.log, and
controller receipt.json remain in the unique 0700
clamav_scan_result_directory.
The initial receipt is incomplete and precedes endpoint operations. It records
boot identity before/after, recovery paths, native runtime diagnostics, exit,
summary counts, retention, and cleanup. The master-start result and both
boot-command results, including failed and unreachable errors, are retained
privately. The initial boot result is saved before its success assertion;
boot-after is skipped when neither local transport nor a successful dedicated
master is available. A failed identity check cannot establish an unchanged
boot identity. execution_finished records native terminal status, including
exit 2. complete additionally requires exit 0 or 1,
a valid summary without reported errors, unchanged boot identity, verified logs,
and successful cleanup. Neither means the host is clean: coverage_complete
remains false and clean remains null. Live files can change, exclusions and
recursion limits omit content, and parser settings constrain inspection.
Scanning a host disk image does not establish guest-filesystem coverage.
Native registered results are the source of status and summary fields. One
final Ansible assertion validates execution, evidence and cleanup, and its
result supplies completion. Receipts before that assertion remain incomplete;
there is no incrementally updated completion flag. native_extraction retains the full unarchive result.
Artifact transfer relies on Ansible fetch’s checksum validation; collection
failure preserves endpoint evidence and its recovery path.
Recovery explicitly cancels only a role-owned forward whose setup succeeded
with exit code 0. Local, skipped, and never-attempted forwards need no release;
failed or uncertain remote forwarding remains conservative. It then
collects logs and cleans verified scratch through the existing authenticated
master. Long scans need no fresh certificate on this normal recovery path.
A nested always exits only that
master and restores caller arguments. Available logs are collected independently
on failure or unreachable results. Scan scratch is deleted only after both logs
are verified retained, a receipt is saved, and terminal process status is known.
Lost connections or failed retention preserve recovery paths; fresh authorized
authentication may be needed to recover them.
4.1 - Defaults
# Existing controller clamd Unix socket; its owner manages signatures/lifecycle.
clamav_scan_socket: "{{ undefined() }}"
# Controller path to //third_party/com_github_cisco_talos_clamav:payload_tar.
clamav_scan_archive: "{{ undefined() }}"
# Existing absolute controller-owned directory with mode 0700.
clamav_scan_report_directory: "{{ undefined() }}"
# GNU timeout deadline, then 15-second kill grace and Ansible supervisor slack.
clamav_scan_timeout_seconds: 86400
# Background scheduling preserves capacity for application workloads.
clamav_scan_background: true
# Native session mode permits concurrent engine processing of uploaded files.
clamav_scan_multiscan: false
# Controller MaxFileSize; client and server stream limits use one extra byte.
clamav_scan_max_file_bytes: 104857600
# Visit all regular files under these roots, subject to recorded omissions.
clamav_scan_roots: [/]
# Explicit subtrees to omit; exclusions are recorded as coverage limitations.
clamav_scan_exclude_paths: []
5 - ComfyUI tools role
This role configures an existing ComfyUI installation from ordinary role
variables. Supply the application directory, runtime arguments and model-directory
map, plus the selected model entries, Git node packs, first-party source paths,
repository-built node bundles, and workflow files. Supply node bundles rooted
at custom_nodes/<directory> and keyed by that directory name.
Required inputs default to null and are validated before
installation; optional inputs have static defaults.
Application and state directory paths may contain hidden components such as
.cache. Supply normalized absolute paths with no . or .. components.
The role knows no profile registry or JSON schema. The deployment playbook loads its JSON and translates it into those variables once, without mutable profile facts. Other callers can supply the same variables directly. Large artifacts remain caller dependencies rather than dependencies of every collection consumer.
defaults/main.yaml documents the complete input contract. Public model URLs
require a publisher commit or SHA-256. Git packs require full commit IDs.
Loopback HTTP model fixtures and local Git repositories are supported for local
acceptance. Gated Hugging Face downloads receive the optional token only on
the publisher request; tasks hide it and redirects do not forward it. The role
accepts comfyui_tools_hugging_face_token as a caller input and never contacts
Vault itself. Set comfyui_tools_require_hugging_face_token when selected model
downloads require authentication. This deployment obtains the token through AL
injection and maps its environment value in the playbook.
Requirements use the existing Python environment with --require-hashes --no-deps.
The role waits for the aggregate /prompt idle count before installation,
before changing loaded code and before restart. It reads no prompts, queue
entries, job history, inputs or outputs. This is an operator-coordinated idle
window, not a lock against another client submitting new work. Changed model,
node, dependency or argument inputs notify one restart. Workflows do not require
a restart. Pass --skip-tags workflows to preserve operator workflow edits.
Unselected files and generated images are retained.
The role manages COMFYUI_ARGS in the supplied environment file. Its baseline
arguments come from the caller; only installed node directories are appended
to the whitelist. The Vast bootstrap preserves this line across reboot.
The optional pinned Video2X installation currently uses /opt/imagegen, the
sequence node’s established tool contract. Other application paths are configurable.
The local acceptance fixture runs the packaged role without a GPU, SSH connection, account credential or live service.
5.1 - Defaults
# Required caller inputs for the existing ComfyUI installation.
comfyui_tools_directory: null
comfyui_tools_arguments: null
comfyui_tools_model_directories: null
comfyui_tools_python_environment: /venv/main
comfyui_tools_state_directory: /opt/imagegen
comfyui_tools_environment_file: /etc/environment
comfyui_tools_api_url: http://127.0.0.1:18188
comfyui_tools_restart_command: [supervisorctl, restart, comfyui]
comfyui_tools_idle_retries: 60
comfyui_tools_idle_delay: 5
# Model entries: filename, kind, immutable URL and optional sha256.
comfyui_tools_models: []
comfyui_tools_hugging_face_token: ""
comfyui_tools_require_hugging_face_token: false
# Git packs: directory name -> {url, ref}; ref is a full immutable commit.
comfyui_tools_git_nodes: {}
# First-party modules and browser scripts: directory name -> controller file.
comfyui_tools_node_sources: {}
comfyui_tools_node_web_scripts: {}
# Repository-built archives rooted at custom_nodes/<directory>: directory name -> controller file.
comfyui_tools_node_archives: {}
# Controller files for locked requirements, native workflows and optional Video2X.
comfyui_tools_python_requirements: ""
comfyui_tools_workflows: []
comfyui_tools_required_nodes: []
comfyui_tools_interpolation_source: ""
6 - Consul
6.1 - Defaults
consul_user: consul
consul_user_uid: 4266
consul_dir: "/opt/consul"
consul_data_dir: "{{ consul_dir }}/data"
consul_config_dir: "{{ consul_dir }}/configs"
consul_config_path: "{{ consul_config_dir }}/consul.hcl"
consul_config_local_path: "files/consul.hcl"
consul_log_dir: "{{ consul_dir }}/logs"
consul_tls_dir: "{{ consul_dir }}/tls"
consul_service_path: "/lib/systemd/system/consul.service"
consul_tls_ca_file_local_path: files/pki_ca_servers.crt
consul_tls_ca_file_path: "{{ consul_tls_dir }}/tls_ca_file.crt"
consul_tls_cert_file_path: "{{ consul_tls_dir }}/cert_file.crt"
consul_tls_key_file_path: "{{ consul_tls_dir }}/key_file.crt"
consul_tls_common_name: "{{ inventory_hostname }}"
consul_tls_ttl: "2629746" # month
consul_tls_alt_names: ""
consul_vault_local_path: "{{ role_path }}/files/vault"
consul_bin_local_path: "{{ role_path }}/files/consul"
consul_bin_path: /usr/bin/consul
7 - Consul
7.1 - Defaults
consul_is_server: false
consul_user_name: consul
consul_user_uid:
consul_dir: "/opt/consul"
consul_persistence_dir: "{{ consul_dir }}"
consul_releases_dir: "{{ consul_dir }}/releases"
consul_config_symlink_dir: "{{ consul_configs_dir }}/current"
consul_config_symlink_data_dir: "{{ consul_config_symlink_dir }}/configs"
consul_configs_dir: "{{ consul_persistence_dir }}/configs/{{ inventory_hostname }}"
consul_data_dir: "{{ consul_persistence_dir }}/data/{{ inventory_hostname }}"
consul_config_path: "{{ consul_config_config_dir }}/consul.json"
consul_config_dir: "{{ consul_configs_dir }}/{{ consul_config_dir_name }}"
consul_config_data_dir: "{{ consul_config_dir }}/data"
consul_config_config_dir: "{{ consul_config_dir }}/configs"
consul_config_dir_name: "{{ consul_config_version }}"
consul_config_version: "{{ lookup('ansible.builtin.pipe', 'git rev-parse HEAD') }}"
consul_env: {}
consul_configs: []
consul_env_path: "{{ consul_config_data_dir }}/consul.env"
consul_env_symlink_path: "{{ consul_config_symlink_dir }}/data/consul.env"
consul_release_dir: "{{ consul_releases_dir }}/{{ consul_release_dir_name }}"
consul_release_dir_name: "{{ consul_release_version }}"
consul_release_symlink_path: "{{ consul_releases_dir }}/current"
consul_release_symlink_bin_path: "{{ consul_release_symlink_path }}/consul"
consul_release_version: 1.20.2
consul_release_archive_name: "consul_{{ consul_release_version }}_linux_amd64"
consul_release_archive_fullname: "{{ consul_release_archive_name }}.zip"
consul_release_bin_path: "{{ consul_release_dir }}/consul"
consul_release_url: "https://releases.hashicorp.com/consul/{{ consul_release_version }}/{{ consul_release_archive_fullname }}"
consul_release_checksum: "sha256:1bf7ddf332f02e6e36082b0fdf6c3e8ce12a391e7ec7dafd3237bb12766a7fd5"
consul_agent_ca_cert_path: "{{ consul_config_data_dir }}/agent_ca_cert.pub"
consul_agent_ca_cert:
consul_server_cert_path: "{{ consul_config_data_dir }}/server_cert_{{ inventory_hostname }}.pub"
consul_server_cert:
consul_server_key_path: "{{ consul_config_data_dir }}/server_cert_{{ inventory_hostname }}.key"
consul_server_key:
8 - Consul envoy
8.1 - Defaults
consul_envoy_dir: "/opt/consul_envoy"
consul_envoy_deployments_dir: "{{ consul_envoy_dir }}/deployments"
consul_envoy_releases_dir: "{{ consul_envoy_dir }}/releases"
consul_envoy_deployment_dir: "{{ consul_envoy_deployments_dir }}/{{ consul_envoy_deployment_version }}"
consul_envoy_release_dir: "{{ consul_envoy_releases_dir }}/{{ consul_envoy_release_version }}"
consul_envoy_configs_dir: "{{ consul_envoy_deployment_dir }}/configs"
consul_envoy_bootstrap_config_path: "{{ consul_envoy_configs_dir }}/bootstrap.json"
consul_envoy_deployment_version: "{{ lookup('ansible.builtin.pipe', 'git rev-parse HEAD') }}"
consul_envoy_user_name: consul_envoy
consul_envoy_release_version: 1.31.0
consul_envoy_release_archive_fullname: "envoy_{{ consul_envoy_release_version }}_linux_amd64.zip"
consul_envoy_release_url: "https://releases.hashicorp.com/envoy/{{ consul_envoy_release_version }}/{{ consul_envoy_release_archive_fullname }}"
consul_envoy_release_bin_path: "{{ consul_envoy_release_dir }}/envoy"
consul_envoy_release_symlink_path: "{{ consul_envoy_releases_dir }}/current"
consul_envoy_release_checksum: "sha256:350782275de0fe50699844b4f9096d77a0193a5bcf205e14b8ad964ec429d45e"
9 - Dev VM
The default task entry point configures package repositories and development
packages. It uses the same dev_vm_packages list with either the ordinary
package manager or RPM-OSTree layering. dev_vm_package_backend accepts
auto, package, or rpm_ostree; auto selects RPM-OSTree when
/run/ostree-booted exists. Set dev_vm_install_packages to false to skip
repository and package management entirely.
RPM-OSTree changes are staged for the next boot by default. The role reports a
pending deployment but does not reboot the host. Set
dev_vm_rpm_ostree_apply_live to true only when live application is known to
be safe for the selected packages.
The packaged Fedora mirror and Bazelisk tool currently make this role specific to Linux x86-64 development hosts.
The packages task entry point exposes package management separately from
other role tasks. The bazel task entry point installs a caller-provided Bazel
rc, Bazelisk, and the repository’s al runner for one developer
account.
Import the Bazel entry point with tasks_from: bazel and set:
dev_vm_bazel_user: owner of the installed files.dev_vm_bazel_group: group of the installed files; defaults to the user.dev_vm_bazel_home: absolute home directory for the developer account.dev_vm_bazelrc_src: controller-side Bazel rc source; defaults tobazelrc.dev_vm_bazelisk_src: controller-side Bazelisk source; defaults tobazelisk.dev_vm_al_src: controller-sidealsource; defaults toal.
The role packages its default Linux x86-64 Bazelisk and al sources.
The calling playbook must package the Bazel rc, plus any overridden binary
sources, in an Ansible file search path. Cache storage and machine-specific
Bazel settings remain the caller’s responsibility.
The optional android task entry point installs the caller-packaged repository
Android installer as dev_vm_bazel_user. Supply dev_vm_android_installer_src
and dev_vm_android_packages_src from //tools/android. It installs missing
packages, accepts their licenses as part of the requested deployment, verifies
each package receipt, and points ndk/current at the selected NDK. It requires
the role’s Java package and does not invoke Bazel on the destination host.
9.1 - Defaults
---
dev_vm_install_packages: true
dev_vm_package_backend: auto
dev_vm_rpm_ostree_apply_live: false
dev_vm_packages:
- acl
- clang
- clang-tools-extra
- java-latest-openjdk-devel
- rust
- cargo
- mesa-libGL-devel
- go
- Xvfb
- python3
- gmp-devel
- patch
- podman
- git
- git-lfs
- fuse
- fuse-libs
- pcsc-lite
- pcsc-lite-devel
- openssl
- gnutls-utils
- opensc
- openssl-pkcs11
- libdnet
- qemu-kvm
- qemu-img
dev_vm_bazel_user: "{{ undefined() }}"
dev_vm_bazel_group: "{{ dev_vm_bazel_user }}"
dev_vm_bazel_home: "{{ undefined() }}"
dev_vm_bazelrc_src: bazelrc
dev_vm_bazelisk_src: bazelisk
dev_vm_al_src: al
dev_vm_selinux_android_emulation: true
dev_vm_android_sdk_root: "{{ dev_vm_bazel_home }}/Android/Sdk"
dev_vm_android_installer_dir: "{{ dev_vm_bazel_home }}/.local/lib/android-installer"
dev_vm_android_installer_src: "{{ undefined() }}"
dev_vm_android_packages_src: "{{ undefined() }}"
dev_vm_android_install_timeout: 1800
10 - DNS
10.1 - Defaults
dns_records: []
dns_domains: []
dns_njalla_api_url: https://njal.la/api/1/
dns_njalla_token:
11 - Docker
11.1 - Defaults
docker_enabled: false
12 - Download host
alwaldend.main.download_host configures download hosts using the existing
host, nginx, and traefik roles. It checks that the selected content device
is a block device before configuring the host, creates Btrfs without
forcing replacement of an existing filesystem, and mounts by UUID. This role
is intended for the Fedora hosts used by infra/download.
The role creates only the publication roots: projects/, third_party/, infra/, sites/, and private
staging/, owned by the download publisher account. Publishers create individual projects,
sites, and releases. The mount root and service state remain root-owned;
privileged ownership changes never traverse per-site directories. Shared Nginx
and Traefik roles own their service units. Traefik uses its standard system-disk
location. A daily systemd timer runs incremental duperemove over projects/, third_party/,
infra/, and sites/ with resource limits and private hash state. Uploading files,
extracting sites, and switching the current-release symlink are separate
publisher operations. Administrators authenticate with existing SSH access and
run publication as this account through sudo. The role does not manage its
authorized_keys and requires no publisher key input. It installs rsync for
SSH transfers.
On SELinux-enabled hosts, the role persists httpd_sys_content_t labels for
static content and applies them with restorecon. This permits confined Nginx
to read the custom document root; ordinary Unix permissions alone do not grant
that access. See Red Hat’s Nginx configuration guide.
Filesystem creation, UUID-based mounting, directories, SELinux labels, and daily
maintenance live in tasks/filesystem.yaml. The pinned
community.general.btrfs_info
module discovers filesystem UUIDs; selection uses the canonical device path so
both direct device paths and by-id symlinks work. Attachment checks remain in
tasks/main.yaml before base-host setup.
Caller contract
- Select target hosts through inventory or deployment wrapper limits and enable privilege escalation. The role does not restrict play size.
- Set
force_handlers: trueon the play so completed configuration changes run their notified handlers even if a later task fails. - Supply
download_content_device. Administrator SSH and sudo access come from the shared host roles; no dedicated upload key is configured. - Override
download_rootanddownload_publisheras needed. The content mount must be under root-owned, non-publisher-writable parent directories. - Keep Traefik configuration and data on the system disk (the shared role
defaults to
/opt/traefik) so content-disk failure does not stop the proxy. - Supply the shared roles’ configuration, including
nginx_config_template, Traefik static/dynamic templates, ACME settings, and base-host variables. The caller owns inventory, firewall policy, Vault references, and routing.
- name: Configure the selected download VM
hosts: download
become: true
force_handlers: true
roles:
- alwaldend.main.download_host
The collection packages the role automatically through its existing role aggregation. Domain-specific serving templates stay with the deployment.
The download_publication tag updates publication roots, read-only SELinux
labels, deduplication units and Nginx without provisioning storage or changing
other host services. It first requires the content root to be a mounted filesystem.
The content mount uses nofail and a ten-second device timeout, so an absent
content disk does not make it mandatory for OS boot. Nginx and deduplication
explicitly require the mount; SSH and Traefik remain on the system disk for
recovery. Missing storage still fails an attempted role deployment. This does
not provide content replication, backup, or automatic recovery of a lost disk.
12.1 - Defaults
# Persistent Btrfs content mount and its non-sudo content owner.
download_root: /srv/download
download_publisher: download
# Required: the content block device. Administrators publish via sudo.
download_content_device: "{{ undefined() }}"
13 - Facts
13.1 - Defaults
facts_debug: false
14 - Filesystem
14.1 - Defaults
filesystem_setup: []
15 - Firewall
The role installs incoming and routed allows, deletes explicitly retired rules,
and enables UFW. All rule operations use community.general.ufw. Rule comments
are descriptive and do not determine which rules are deleted.
For an enabled policy, the role enables and starts ufw.service before
updating rules. This restores an existing policy after reboot even when an
older deployment left the service disabled. Firewalld is stopped first because
its service conflicts with UFW. The role also masks firewalld when its package
is absent, so later dependency installation cannot enable the conflicting
service. A disabled policy also disables UFW startup.
Declare retired rules in firewall_delete_rules, which defaults to an empty
list. Removing an entry from firewall_allow_port_from or
firewall_allow_forward alone leaves its installed rule in place. Add a matching
deletion entry and retain it for hosts that may have missed earlier deployments.
Unlisted rules remain; the role does not reset the firewall.
Each deletion requires rule (allow, deny, reject, or limit) and accepts
the module’s name, proto, port, from_port, src, dest, direction, and
route parameters. Sources and destinations default to any; route defaults
to false. Omitted protocol, port, direction, and application parameters retain
the module defaults. Match the original rule specification, including any
destination or routing constraint. Application profiles use name without
proto or port.
firewall_delete_rules:
- rule: allow
port: "8080"
proto: tcp
- rule: allow
name: mDNS
dest: 224.0.0.251
- rule: allow
route: true
src: 192.0.2.0/24
dest: 198.51.100.0/24
Install replacement management access in firewall_allow_port_from before
retiring an SSH profile; desired allows run before deletions. Do not also declare
a retired rule as a desired allow. The download consumer declares TCP 22 and
explicitly retires inherited SSH and mDNS profile rules, including the IPv4
and IPv6 multicast destinations.
15.1 - Defaults
firewall_state: enabled
firewall_enabled: true
firewall_allow_port_from: []
firewall_allow_forward: []
# Explicit UFW rule specifications to delete after desired allows are installed.
firewall_delete_rules: []
16 - Forgejo
The role manages Forgejo’s executable, configuration and systemd unit. When startup contents change, it stages the candidate, drains and stops the old service, archives the declared files, installs and starts the candidate, then checks HTTP health, the running version and database consistency. Unchanged runs repair file ownership and modes without restarting or archiving.
Declare the deployment layout
This workflow supports a local SQLite database, local storage and an HTTP
backend, including HTTP behind a separately managed TLS proxy. Set
forgejo_database_path to the SQLite file used by the configuration template;
it defaults to {{ forgejo_work_dir }}/data/forgejo.db.
forgejo_backup_paths is the complete archive contract. Defaults cover
forgejo_dir, the configuration, executable and unit. Add every external local
storage directory and referenced secret file, including symlink targets, an
external Git home, LFS/package storage or token files. The role checks declared
inputs and managed state/startup coverage before an activation. It does not
scan trees for symlinks or discover paths from INI settings. Keep the existing configuration’s persistence paths stable;
coordinate relocation and external-database/storage backups separately.
Use absolute file-backed secret references across releases.
Paths must be literal normalized absolute paths. Recovery storage defaults to
/var/backups/forgejo and must be outside the archive inputs. Declared paths
pass directly to tar, preserving case-distinct and overlapping roots. The host
must provide GNU realpath, GNU tar and gzip. Before activation, separation
is checked after resolving symlinks, including a not-yet-created recovery directory.
Existing inputs and the configured SQLite file must exist before an upgrade.
Partial installations and downgrades fail before stopping.
The supplied template owns the SQLite/HTTP layout. The role uses the existing
INI filter only to reject changes to SECRET_KEY or SECRET_KEY_URI.
Key bindings must be literal values; interpolated %(...)s expressions are
rejected before downtime rather than resolved by the upgrade role.
Candidate execution is checked once on the managed host. Changed inputs are staged before this check; unchanged runs inspect the installed executable.
The role manages the account and acl, git, git-lfs packages by default.
Callers disabling forgejo_manage_user or forgejo_manage_packages supply those
prerequisites. ACL support is needed for unprivileged Ansible module execution.
Serialize upgrades per instance. Check mode cannot verify this transaction.
Optional custom header
Set forgejo_custom_header_local_path to a controller-side Forgejo template
file. The role installs it under forgejo_work_dir/custom/templates/custom/header.tmpl
through the guarded activation workflow. The file contents are copied literally.
An empty source path leaves the installed header unmanaged.
Optional SSH commit-signing pair
Set forgejo_signing_ssh_key to a dictionary with private_key and public_key
strings to install a dedicated Ed25519 pair before service activation. It defaults
to an empty dictionary. The caller owns secure generation and storage and must
supply Git 2.34+ and OpenSSH ssh-keygen 8.2p1+ on the managed host. Configure
the service template with FORMAT = ssh and
SIGNING_KEY = {{ forgejo_dir }}/signing/instance.pub, plus its signing identity.
The role validates the pair, installs private/public files with modes 0600/0644
under a service-owned 0700 directory, and rejects different existing private
content. Matching reruns repair metadata and public content without restarting.
The files remain under forgejo_dir and its existing backup coverage. The role
does not generate, rotate, or publish keys. Secret-bearing tasks suppress output;
their temporary candidate is removed even on validation failure.
Recovery
Every changed existing installation retains a private recovery directory with
snapshot.tar.gz and manifest.json. Directories use mode 0700; archives and
manifests use 0600. They remain on the managed host and contain secrets.
Provision sufficient space and independent disaster-recovery backups; retention
cleanup is an operator responsibility.
If draining fails, the old instance stays running. If preparation or archiving
fails before startup-file replacement, an intact previously active service is
restarted. After replacement begins, failed acceptance leaves the candidate
stopped. There is no automatic downgrade against potentially migrated data.
A pending.json marker blocks retries until explicit recovery or a deliberate
corrected retry; it is removed only after successful acceptance.
To restore, stop Forgejo, verify the selected archive/checksum, and move aside
its candidate data trees. Extract the complete archive into / (the manifest’s
archive_root), preserving numeric ownership and permissions. The archive
contains the directory roots and their metadata; no separate reconstruction
step is needed.
Restore the old executable, configuration and unit together with their data,
reload systemd and start that version. Verify service and application behavior
before removing the pending marker. Restoration can discard later writes and
requires explicit operator authorization.
Verification
bazel test //projects/ansible_collection/test/forgejo_upgrade:upgrade_test
runs actual Forgejo 15.0.3 and 17.0.1 with disposable SQLite state and a bounded
service-manager fixture. It checks upgrade/restore, unchanged runs, explicit
backup validation and failure recovery. Sanitized JSON results are retained;
fixture credentials and archives are discarded. The signing case verifies a real
API-generated commit with the installed SSH pair and checks unchanged runs and
private-key mismatch refusal. Real systemd, cross-account SSH and production
data are outside this rehearsal.
16.1 - Defaults
forgejo_user: forgejo
forgejo_group: "{{ forgejo_user }}"
forgejo_owner: root
forgejo_manage_packages: true
forgejo_manage_user: true
forgejo_signing_ssh_key: {}
forgejo_user_uid: 5157
forgejo_dir: "/opt/forgejo"
forgejo_data_dir: "{{ forgejo_dir }}/data"
forgejo_config_dir: "{{ forgejo_dir }}/configs"
forgejo_work_dir: "{{ forgejo_dir }}/work"
forgejo_custom_header_local_path: ""
forgejo_config_path: "{{ forgejo_config_dir }}/forgejo.ini"
forgejo_config_local_path: "files/forgejo.ini"
forgejo_disk:
forgejo_log_dir: "{{ forgejo_dir }}/logs"
forgejo_service_path: "/lib/systemd/system/forgejo.service"
forgejo_vault_local_path: "{{ role_path }}/files/vault"
forgejo_bin_local_path: "{{ role_path }}/files/forgejo"
forgejo_bin_path: /usr/bin/forgejo
forgejo_database_path: "{{ forgejo_work_dir }}/data/forgejo.db"
forgejo_backup_dir: /var/backups/forgejo
forgejo_backup_paths:
- "{{ forgejo_dir }}"
- "{{ forgejo_config_path }}"
- "{{ forgejo_bin_path }}"
- "{{ forgejo_service_path }}"
forgejo_queue_timeout: 120s
forgejo_health_url: http://127.0.0.1:3000
forgejo_health_retries: 60
forgejo_health_delay: 2
17 - Forgejo
17.1 - Defaults
threexui_user: threexui
threexui_user_uid: 6468
threexui_dir: "/opt/threexui"
threexui_data_dir: "{{ threexui_dir }}/data"
threexui_work_dir: "{{ threexui_dir }}/work"
threexui_disk:
threexui_log_dir: "{{ threexui_dir }}/logs"
threexui_service_path: "/lib/systemd/system/threexui.service"
threexui_vault_local_path: "{{ role_path }}/files/vault"
threexui_bin_dir: "{{ threexui_dir }}/bin"
threexui_bin_local_dir: "{{ role_path }}/files/threexui_bin"
threexui_config_dir: "{{ threexui_dir }}/configs"
threexui_env_path: "{{ threexui_config_dir }}/threexui.env"
threexui_env_override: {}
threexui_base_path: /
threexui_username: "{{ undefined() }}"
threexui_password: "{{ undefined() }}"
threexui_port: "2053"
threexui_debug: "false"
threexui_env:
# https://docs.sanaei.dev/docs/reference/env-vars/
XUI_DB_TYPE: sqlite
XUI_DB_FOLDER: "{{ threexui_data_dir }}"
XUI_PORT: "{{ threexui_port }}"
XUI_INIT_WEB_BASE_PATH: "{{ threexui_base_path }}"
XUI_ENABLE_FAIL2BAN: "true"
XUI_SKIP_HSTS: "true"
XUI_LOG_LEVEL: info
XUI_DEBUG: "{{ threexui_debug }}"
XUI_LOG_FOLDER: "{{ threexui_log_dir }}"
XUI_BIN_FOLDER: "{{ threexui_bin_dir }}/bin"
XRAY_VMESS_AEAD_FORCED: "false"
XUI_ACCESS_URL: "https://{{ inventory_hostname }}{{ threexui_base_path }}"
XUI_USERNAME: "{{ threexui_username }}"
XUI_PASSWORD: "{{ threexui_password }}"
18 - Forgejo runner
Installs the repository-pinned Linux x86-64 Forgejo runner, creates its service
account, registers it once, and manages forgejo-runner.service. Set
forgejo_runner_dir to choose the installation directory (default
/opt/forgejo-runner). It contains the root-owned forgejo-runner executable
and config.yaml, and runner-owned home/ and work/ directories. The unit
is installed in /etc/systemd/system. Registration and the daemon use the
same configuration and work/.runner file.
Supply forgejo_runner_instance and forgejo_runner_token for initial
registration. forgejo_runner_name defaults to the inventory hostname. The
deployment supplies the token through its existing Vault injection flow; the
role passes it through stdin with logging suppressed and a bounded registration
deadline. Neither the worker nor this role performs Vault or OIDC login.
Once work/.runner exists, deployment needs no registration token or instance
input. That file contains the worker credentials and is restricted to mode
0600. Changing labels or capacity updates the
daemon configuration; changing a registered runner’s instance or identity
requires deliberate re-registration.
For an identity already created through Forgejo’s API, supply
forgejo_runner_credentials with id, uuid, token, instance and name.
The instance and name must match the role’s configured values. The role installs
this identity only when work/.runner is absent, with secret logging suppressed;
it does not register another worker or overwrite existing credentials.
forgejo_runner_labels and forgejo_runner_capacity control job selection and
concurrency. forgejo_runner_config supplies advanced settings using upstream
YAML keys. Its default mapping is shown in defaults.
Replacing it replaces that mapping; unspecified upstream settings use the
runner’s defaults. The role always sets runner.file, runner.labels,
runner.capacity and host.workdir_parent to match its own inputs.
For example, to change the job timeout and enable the cache:
forgejo_runner_config:
log:
level: info
job_level: info
runner:
timeout: 4h
shutdown_timeout: 30s
insecure: false
cache:
enabled: true
Set forgejo_runner_install_packages: false when the calling deployment supplies
all runner packages, including on RPM-OSTree hosts.
Node.js is required for JavaScript actions such as checkout.
The acl package must be available for Ansible to execute registration as the
unprivileged runner account; the role includes it in its package defaults.
Complete any required reboot before starting this role. Container runtime
installation and configuration remain the caller’s responsibility; Podman is
not installed for the default host executor. The default installation
and service paths are writable on OSTree hosts.
Host executor labels run jobs as the runner account without job isolation. Restrict registration to trusted repositories and keep deployment credentials out of the runner environment. The role does not grant sudo access. The Actions cache service is disabled by default; enable it only after configuring its network reachability. Configuration, binary, and service changes trigger a handler to reload systemd and restart the runner.
Callers that install build tools into the runner’s home can import install
first and service after their prerequisites. The normal role entry point runs
both phases. Installation defers restarts; the service phase marks prerequisites
ready and flushes pending handlers. If prerequisite setup fails, forced handlers
leave a fresh worker stopped.
Registration failures produce a fixed message. Check initial inputs, connectivity, TLS trust and Ansible’s ability to switch to the runner account; keep secret-bearing command output suppressed.
Older path overrides are replaced by forgejo_runner_dir, preserving the
default layout. Migrate forgejo_runner_timeout and
forgejo_runner_shutdown_timeout to runner.timeout and
runner.shutdown_timeout under forgejo_runner_config, and
forgejo_runner_cache_enabled to cache.enabled. The service stop deadline
remains forgejo_runner_service_stop_timeout; keep it longer than the configured
runner shutdown timeout.
The local acceptance fixture exercises registration and renders both templates without deploying a worker.
18.1 - Defaults
---
forgejo_runner_user: forgejo-runner
forgejo_runner_user_uid: 5721
forgejo_runner_dir: /opt/forgejo-runner
forgejo_runner_install_packages: true
forgejo_runner_packages:
- acl
- git
- nodejs
forgejo_runner_instance: "{{ undefined() }}"
forgejo_runner_token: "{{ undefined() }}"
forgejo_runner_credentials: {}
forgejo_runner_name: "{{ inventory_hostname }}"
forgejo_runner_labels:
- "self-hosted:host"
forgejo_runner_capacity: 1
forgejo_runner_service_stop_timeout: 60s
forgejo_runner_registration_timeout: 120
forgejo_runner_config:
log:
level: info
job_level: info
runner:
timeout: 3h
shutdown_timeout: 30s
insecure: false
cache:
enabled: false
19 - Gpg
19.1 - Defaults
gpg_users: []
20 - Grafana role
Run alwaldend.main.grafana with privilege escalation on Fedora. The role
installs the Fedora Grafana package, stores data in the RPM’s SQLite
directory, listens on loopback, and checks database health after starting
the systemd service. Set grafana_hostname to the HTTPS hostname served by
the reverse proxy.
Supply the local recovery password, encryption key, and OIDC client secret as files on the Ansible controller. Set the OIDC client ID, browser authorization URL, token URL, UserInfo URL, and administrator group. Members of that OIDC group receive Grafana server administrator access. The role enables PKCE and keeps the local login available for recovery.
Set grafana_feature_toggles to enable deployment-specific Grafana features.
20.1 - Defaults
grafana_hostname: "{{ undef() }}"
grafana_http_port: 3000
grafana_feature_toggles: []
grafana_admin_password_src: "{{ undef() }}"
grafana_secret_key_src: "{{ undef() }}"
grafana_oidc_client_id: "{{ undef() }}"
grafana_oidc_client_secret_src: "{{ undef() }}"
grafana_oidc_auth_url: "{{ undef() }}"
grafana_oidc_token_url: "{{ undef() }}"
grafana_oidc_userinfo_url: "{{ undef() }}"
grafana_oidc_name: OIDC
grafana_oidc_scopes: openid profile email groups
grafana_oidc_login_attribute: preferred_username
grafana_oidc_admin_group: "{{ undef() }}"
21.1 - Defaults
harbor_user: harbor
harbor_user_uid: 7049
harbor_dir: "/opt/harbor"
harbor_installer_dir: "{{ harbor_dir }}/installer"
harbor_logs_dir: "{{ harbor_dir }}/logs"
harbor_data_dir: "{{ harbor_dir }}/data"
harbor_installer_local_dir: "{{ role_path }}/files/harbor_installer"
harbor_config_path: "{{ harbor_installer_dir }}/harbor.yml"
harbor_config_local_path: "files/harbor.yaml"
harbor_domain: "{{ undefined() }}"
harbor_ca_local_path: "{{ role_path }}/files/pki_ca_servers.crt"
harbor_ca_path: /etc/docker/certs.d/{{ harbor_domain }}/ca.crt
harbor_root_ca_local_path: "{{ role_path }}/files/pki_ca_root.crt"
22 - Hermes
22.1 - Defaults
hermes_user: hermes
hermes_user_uid: 8150
hermes_dir: /opt/hermes
hermes_home_dir: "{{ hermes_dir }}/home"
hermes_install_dir: "{{ hermes_dir }}/hermes-agent"
hermes_disk:
hermes_port: 8642
hermes_commit: "{{ undefined() }}"
hermes_installer_local_path: "{{ role_path }}/files/install.sh"
hermes_installer_path: "{{ hermes_dir }}/install.sh"
hermes_config_local_path: "files/hermes.yaml"
hermes_config_path: "{{ hermes_home_dir }}/.hermes/config.yaml"
hermes_env_path: "{{ hermes_home_dir }}/.hermes/.env"
hermes_env: {}
hermes_bin_path: "{{ hermes_home_dir }}/.local/bin/hermes"
hermes_dashboard_service_path: /lib/systemd/system/hermes-dashboard.service
23 - Hiddify manager
23.1 - Defaults
hiddify_manager_env:
HIDDIFY_MANAGER_IMAGE: ghcr.io/hiddify/hiddify-manager:main@sha256:d5edef06d2133ffa26f0fcbb67e711f4356dba44c44a41a96570c4e03845a84c
HIDDIFY_MANAGER_REDIS_IMAGE: redis:7.4.1@sha256:bb142a9c18ac18a16713c1491d779697b4e107c22a97266616099d288237ef47
HIDDIFY_MANAGER_MARIADB_IMAGE: mariadb:11.6.2@sha256:a9547599cd87d7242435aea6fda22a9d83e2c06d16c658ef70d2868b3d3f6a80
HIDDIFY_MANAGER_REDIS_PASSWORD: "{{ lookup('ansible.builtin.env', 'HIDDIFY_MANAGER_REDIS_PASSWORD', default=undef()) }}"
HIDDIFY_MANAGER_MYSQL_PASSWORD: "{{ lookup('ansible.builtin.env', 'HIDDIFY_MANAGER_MYSQL_PASSWORD', default=undef()) }}"
HIDDIFY_MANAGER_MARIADB_PASSWORD: "{{ lookup('ansible.builtin.env', 'HIDDIFY_MANAGER_MARIADB_PASSWORD', default=undef()) }}"
hiddify_manager_env_override: {}
hiddify_manager_dir: /opt/hiddify_manager
24 - Hiddify manager with host
24.1 - Defaults
25 - Host
Common setup invokes update_all_packages once for immediate package updates
and native automatic-update configuration. Set
update_all_packages_automatic_enabled: true
to enable native security-update timers, or staged image updates on OSTree.
Automatic reboots are disabled. Immediate reboots also default to disabled;
update_all_packages_reboot_enabled: true explicitly permits a required reboot.
25.1 - Defaults
26 - Install CA
26.1 - Defaults
install_ca:
- path: "{{ role_path }}/files/pki_ca_root.crt"
- path: "{{ role_path }}/files/pki_ca_servers.crt"
27 - K3s
Set k3s_manifests_local_path, k3s_auth_config_local_path, or
k3s_admission_config_local_path to an empty string to omit that file during
bootstrap.
Set k3s_server_ca_vault_path to a Vault KV v2 API path such as
secrets/data/example/kubernetes_ca to publish the public server CA after
K3s starts. The controller uses the injected Vault connection and credentials.
The role stores server-ca.crt as certificate and writes a new version
only when the certificate changes. An empty path disables publication.
27.1 - Defaults
k3s_data_dir: /srv/k3s_data
k3s_service_name: k3s
k3s_data_disk: /dev/sdb
k3s_storage_dir: /srv/k3s_storage
k3s_storage_disk: /dev/sdc
k3s_config_path: "/etc/rancher/k3s/config.yaml"
k3s_config_local_path: "files/k3s.yaml"
k3s_admission_config_path: "/etc/rancher/k3s/admission.yaml"
k3s_admission_config_local_path: "files/k3s_admission.yaml"
k3s_auth_config_path: "{{ [(k3s_config_path | dirname), 'k3s_auth.yaml'] | path_join }}"
k3s_auth_config_local_path: "files/k3s_auth.yaml"
k3s_manifests_local_path: "files/k3s_manifests.yaml"
k3s_manifests_path: "{{ k3s_data_dir }}/server/manifests/k3s-manifests.yaml"
k3s_bin_local_path: "{{ role_path }}/files/k3s"
k3s_bin_path: /usr/local/bin/k3s
k3s_install_script_local_path: "{{ role_path }}/files/k3s_install"
k3s_install_script_path: /usr/local/bin/k3s_install
k3s_server_ca_vault_path: ""
28 - K3s bootstrap
The role declares Python and uv as host packages, creates its Kubernetes virtual
environment with uv venv, and installs the Python client with uv pip install.
The environment is created only when its interpreter is missing; package installs
report changes only when uv installs or removes distributions. These operations
run during an explicitly authorized role deployment and require package-index
access. Repository validation builds and renders the role without deploying it.
28.1 - Defaults
k3s_bootstrap_apply_path:
k3s_bootstrap_token_name: "{{ lookup('ansible.builtin.env', 'USER', default=undef()) }}"
k3s_bootstrap_token_namespace: kube-system
k3s_bootstrap_venv_dir: "/opt/bootstrap-venv"
k3s_bootstrap_venv_bin: "{{ k3s_bootstrap_venv_dir | mandatory }}/bin/python"
k3s_bootstrap_kubeconfig: /etc/rancher/k3s/k3s.yaml
k3s_bootstrap_cluster_name: "{{ inventory_hostname }}"
k3s_bootstrap_cluster_ca_path: "{{ lookup('ansible.builtin.env', 'HOME', default=undef()) }}/.kube/ca-{{ k3s_bootstrap_cluster_name | mandatory }}.ca.crt"
k3s_bootstrap_user_ca_path: "{{ k3s_bootstrap_cluster_ca_path | mandatory | dirname }}/ca-{{ k3s_bootstrap_cluster_name | mandatory }}-{{ k3s_bootstrap_token_name | mandatory }}.ca.crt"
k3s_bootstrap_user_name: "{{ k3s_bootstrap_cluster_name | mandatory }}-{{ k3s_bootstrap_token_name | mandatory }}"
k3s_bootstrap_cluster_port:
29 - K3s cluster
29.1 - Defaults
30 - K3s kubeconfig
30.1 - Defaults
k3s_kubeconfig_secret_path: "{{ undefined() }}"
k3s_kubeconfig_secret_mount: "{{ undefined() }}"
k3s_kubeconfig_path: /etc/rancher/k3s/k3s.yaml
k3s_kubeconfig_vault_bin_local_path: "{{ role_path }}/files/vault"
31 - llama.cpp
Installs caller-supplied, Bazel-verified llama.cpp and CUDA archives on Linux x86-64, verifies and stages a GGUF, and manages a loopback-only systemd server. The caller owns archive pins and packaging, driver provisioning, and GPU/image requirements. No runtime archive or model is downloaded by this role.
Supply llama_archive_src, llama_cuda_archive_src, an absolute controller-side
llama_model_src, and llama_model_sha256. Both runtime archives must have one
top-level directory; extraction strips that level and places the libraries
beside llama-server. The role verifies shared-library resolution and CUDA device
discovery before starting inference. It creates a separate non-login account,
keeps the runtime administrator-owned, and makes the model group-readable.
Changed inputs notify a restart; readiness follows pending restarts. Repeated unarchive comparison repairs interrupted extraction and preserves unchanged installations. The role contains no Codex provider or Responses bridge logic.
31.1 - Defaults
llama_user: llama
llama_uid: 1101
llama_home: /var/lib/llama
llama_runtime_dir: /opt/llama/runtime
llama_archive_src: "{{ undefined() }}"
llama_cuda_archive_src: "{{ undefined() }}"
llama_model_src: "{{ undefined() }}"
llama_model_sha256: "{{ undefined() }}"
llama_model_path: "{{ llama_home }}/model.gguf"
llama_model_alias: model
llama_context_size: 32768
llama_port: 8080
llama_device: CUDA0
llama_service_path: /etc/systemd/system/llama-server.service
32 - lvg
lvg_volume_groups describes the complete desired physical-volume list for
each volume group. Extra physical volumes are not removed unless a caller sets
remove_extra_pvs: true.
Creating a volume group initializes every listed device as an LVM physical
volume. Callers must resolve stable device paths and verify that each device is
the intended, unused disk before applying this role; pvcreate may overwrite
an existing disk signature.
32.1 - Defaults
lvg_volume_groups: []
33 - lvol
Each lvol_volumes entry can constrain allocation with pvs, pass creation
arguments with opts, and disable shrinking with shrink: false.
33.1 - Defaults
lvol_volumes: []
34 - Lynis audit
alwaldend.main.lynis_audit extracts the packaged CISOfy source archive into a
root-owned 0700 temporary directory and runs an audit as root.
The Linux target must have a POSIX shell, tar, GNU timeout, and a remote Python
version supported by the packaged Ansible runtime. The role requires privilege
escalation to root and does not support Ansible check mode. It does not install
Python or provide a legacy transport fallback.
Supply lynis_audit_archive as the controller path to the archive packaged from
//third_party/com_github_cisofy_lynis:archive. Supply
lynis_audit_report_directory as an existing absolute controller directory,
owned by the controller user with mode 0700. In repository operations, place it
under the task’s ignored out/ directory. lynis_audit_timeout_seconds defaults
to 900, with a further 15-second termination grace period and a maximum of 3600.
Each invocation creates a unique 0700 result directory and exposes its path as
lynis_audit_result_directory. It retains 0600 console.log, lynis.log,
lynis-report.dat, and result.json files. The role writes an incomplete receipt
first, then records the remote scratch recovery path before preparing or running
the scanner. The receipt and lynis_audit_exit_code record the scanner status;
the exit code remains null when command execution supplies none. Transport and
collection errors are retained in the private receipt, without exposing their
contents through Ansible output.
The audit runs through native Ansible async polling, with its job data under the private audit directory. A finished result supplies the scanner return code; missing, unreachable or unfinished results supply none. This separates scanner status from the SSH polling process without an encoded stdout protocol. The console is still redirected to a private file, preserving partial output.
Completion requires exit 0 (without warnings) or 78 (with warnings), successful
retention of all existing evidence, and a fully fetched report containing
finish=true and a positive integer lynis_tests_done. An accepted exit alone
does not establish completion. Other statuses, unfinished or zero-test reports,
and collection failures fail the role after available evidence is collected.
Timeout statuses 124 or 137 indicate incomplete evidence; available partial
artifacts are retained. Empty files can indicate failure before scanner output.
The command retains audit system with all test groups and --cronjob. In the
pinned source, --quick only skips input pauses; it does not select fewer tests.
--cronjob already enables that behavior and noninteractive handling of an
existing scanner PID file, so a separate --quick is redundant. It does not
install a cron job. Individual checks still depend on host applicability and
the profile exclusions below.
The command uses the extracted source and profiles through --usecwd, disables
plugins, uploads, and scanner update checks, and disables package repository
refreshes. The packaged source contains no runnable plugins, only a plugin
template and its README. The shared profile also skips DNF/YUM checks that can
mutate caches independently of refresh-repositories=no:
PKGS-7350: installed-package inventory through DNF.PKGS-7352: DNF security-update advisories and vulnerable-package reporting.PKGS-7354: DNF package-database integrity checks.PKGS-7383: YUM repository/package-update management checks.PKGS-7384: YUM utilities, duplicate packages, and package-database problems.PKGS-7386: YUM security support and missing security-update checks.PKGS-7387: enabled YUM repositories’ GPG-signature configuration.
Consequently, this audit omits those DNF/YUM package inventory, security advisory,
database, repository, and signature checks; other applicable package checks can
still run. Package maintenance belongs to the caller’s dedicated workflow.
Normal system and DNS checks remain enabled; this is not an offline sandbox.
The role installs no package, service, schedule, or automatic remediation.
Lynis assesses system hardening and does not establish absence of compromise.
The pinned include/tests_malware primarily checks for installed security tools
and related processes; it does not run a comprehensive antivirus or rootkit
scan. A completed audit therefore does not certify the host free of malware.
Lynis itself creates private /tmp/lynis.* files and /var/run/lynis.pid, which
its normal exit handler removes. A forced termination can leave these behind.
The role removes its allocated remote directory only after all evidence paths
have been inspected, every existing evidence file has been fetched successfully,
the collection receipt has been saved, and terminal scanner status is known.
This permits cleanup after a failed or timed-out scan when its partial artifacts
were retained. A stat or fetch
failure leaves the remote directory in place and fails the role; consult
result.json for the private remote_directory recovery path and diagnostics.
The recorded path may already be absent after successful collection and cleanup.
An unreachable host or interrupted controller can prevent collection or cleanup;
the initial receipt and recorded recovery path survive. The role never removes
an existing scanner’s PID or temporary files. Reports contain host details and
should remain private.
34.1 - Defaults
# Controller path to the packaged //third_party/com_github_cisofy_lynis:archive.
lynis_audit_archive: "{{ undefined() }}"
# Existing absolute controller directory, owned by its user with mode 0700.
lynis_audit_report_directory: "{{ undefined() }}"
# GNU timeout terminates the process group, with a further 15-second kill grace.
lynis_audit_timeout_seconds: 900
35 - MLflow
alwaldend.main.mlflow installs a caller-supplied runtime archive and enables
the MLflow tracking service and Vast.ai coordinator on a Linux systemd host.
Run it with privilege escalation. The services listen on loopback and keep
their data in /var/lib/mlflow-tracking and /var/lib/mlflow-vastai.
Supply mlflow_runtime_archive as a controller-side path to a tar archive with
mlflow, its runfiles, and mlflow-vastai at the archive root. The role
extracts each archive revision into its own directory and activates it at
/opt/mlflow/current.
Set mlflow_tracking_uri to the authenticated URL used by clients and workers.
The runtime archive must include the MLflow OIDC plugin and a coordinator
that supports a bearer-token file. Supply the OIDC provider registry,
permitted groups, client secret file, session signing key file, and coordinator token
file. The coordinator also needs its Vast.ai API key, allowed rentals, SSH
identity, and verified host keys. The caller configures the HTTPS reverse
proxy and prepares the workers.
When the caller provides dedicated volumes, set mlflow_require_data_mounts
to true and mount them before invoking the role. Tracking then requires
mounts at /var/lib/mlflow-tracking and /var/lib/mlflow-tracking/artifacts.
The coordinator requires a mount at /var/lib/mlflow-vastai.
Set mlflow_enable_coordinator to false to install tracking independently.
Provide only the browser OIDC registry entries in this mode. The role skips
coordinator setup and leaves any previously installed coordinator untouched.
35.1 - Defaults
# Controller-side archive containing the MLflow CLI, its runfiles, and mlflow-vastai.
mlflow_runtime_archive: "{{ undef() }}"
# Tracking URL reachable by the coordinator, project submitters, and workers.
mlflow_tracking_uri: "{{ undef() }}"
mlflow_hostname: "{{ mlflow_tracking_uri | urlsplit('hostname') }}"
mlflow_tracking_port: 5000
mlflow_coordinator_port: 50051
mlflow_enable_coordinator: true
# Require separate mounts at the tracking, artifacts, and coordinator state paths.
mlflow_require_data_mounts: false
# Override the package name for distributions that package OpenSSH differently.
mlflow_ssh_client_package: openssh-clients
mlflow_worker_user: root
# The allowed rental selectors are supplied as one comma-separated string.
mlflow_vastai_workers: "{{ undef() }}"
mlflow_vast_api_key: "{{ undef() }}"
mlflow_tracking_token_src: "{{ undef() }}"
mlflow_oidc_providers: "{{ undef() }}"
mlflow_oidc_client_secret_src: "{{ undef() }}"
mlflow_oidc_session_key_src: "{{ undef() }}"
mlflow_oidc_groups: "{{ undef() }}"
mlflow_oidc_admin_groups: []
# Controller-side paths to the coordinator's SSH identity and trusted host keys.
mlflow_worker_ssh_key: "{{ undef() }}"
mlflow_worker_known_hosts: "{{ undef() }}"
36 - Mount
Mount entries can set opts, dump, and passno; state: mounted keeps the
mount active and writes its persistent /etc/fstab entry.
36.1 - Defaults
mount_points: []
37 - Nginx
Installs Fedora’s nginx package and manages its native systemd service.
The consumer supplies a complete nginx_config_template, including listeners,
HTTP settings, MIME includes, and document roots. Replacing the main config
also removes package-default virtual hosts from the active configuration.
Ansible renders and validates the entire candidate with nginx -t -c before
atomically replacing nginx_config_path. Invalid candidates leave the prior
configuration and running service intact. Valid changes notify a reload;
an unchanged run does not restart or reload Nginx. The role never manages
published content. Packages can be caller-managed with
nginx_manage_packages: false.
The download component owns its routes, storage permissions, SELinux labels, and the Traefik TLS frontend. The role validation record links the consumer fixture and lifecycle results.
nginx_requires_mounts_for defaults to an empty list. When configured, the role
writes a systemd RequiresMountsFor override and reloads unit definitions.
Content services therefore wait for their required mounts and cannot start
against an unmounted directory. Keep these paths administrator-owned.
37.1 - Defaults
# Complete configuration template owned by the consumer.
nginx_config_template: "{{ undefined() }}"
nginx_config_path: /etc/nginx/nginx.conf
nginx_binary: /usr/sbin/nginx
nginx_manage_packages: true
nginx_packages:
- nginx
nginx_service_name: nginx
# Mounts required before starting the content service.
nginx_requires_mounts_for: []
38 - OpenCanary role
Installs OpenCanary in a Python virtual environment on Fedora and runs it as
an unprivileged systemd service. Set opencanary_services to a mapping of
module names to port and protocol pairs. Enable the optional audited,
read-only Samba decoy with opencanary_smb_enabled.
When HTTPS is enabled, set opencanary_https_sign_path to a Vault PKI signing
endpoint to maintain the HTTPS certificate with the
Vault server certificate role.
Use the opencanary_tls tag to check or renew it on an existing host.
Events go to the system journal. Only supply an address range the guest is intended to monitor when permitting inbound access to decoy ports.
38.1 - Defaults
opencanary_version: "0.9.10"
opencanary_services:
http: {port: 80, proto: tcp}
opencanary_smb_enabled: false
opencanary_https_certificate: /var/lib/opencanary/https.pem
opencanary_https_key: /var/lib/opencanary/https.key
opencanary_https_sign_path: ""
39 - Opencode
39.1 - Defaults
opencode_user: opencode
opencode_user_uid: 8149
opencode_dir: "/opt/opencode"
opencode_port: 4096
opencode_domain: "{{ undefined() }}"
opencode_log_dir: "{{ opencode_dir }}/logs"
opencode_work_dir: "{{ opencode_dir }}/work"
opencode_home_dir: "{{ opencode_dir }}/home"
opencode_config_dir: "{{ opencode_home_dir }}/.config/opencode"
opencode_config_path: "{{ opencode_config_dir }}/opencode.json"
opencode_config_local_path: "files/opencode.json"
opencode_disk:
opencode_service_path: "/lib/systemd/system/opencode.service"
opencode_bin_local_path: "{{ role_path }}/files/opencode"
opencode_bin_path: /usr/bin/opencode
opencode_env_path: "{{ opencode_config_dir }}/opencode.env"
opencode_env_override: {}
opencode_ssh_public_key: "{{ undefined() }}"
opencode_ssh_private_key: "{{ undefined() }}"
opencode_server_username: "{{ undefined() }}"
opencode_server_password: "{{ undefined() }}"
opencode_env:
OPENCODE_SERVER_USERNAME: "{{ opencode_server_username }}"
OPENCODE_SERVER_PASSWORD: "{{ opencode_server_password }}"
40 - OpenHands automation
Runs the OpenHands automation server natively from a uv-managed virtual
environment. It stores schedules and event triggers, tracks run lifecycle, and
dispatches conversations to the agent server.
The automation server is not a sandbox. It records which agent server should
run a dispatched conversation and hands that work to
AUTOMATION_AGENT_SERVER_URL; setting that variable selects the agent
server’s local mode, which uses a persistent local agent server instead of
managed OpenHands Cloud sandboxes.
openhands_automation_agent_server_api_key must equal the agent server’s
session API key because both services authenticate the same
X-Session-API-Key value. openhands_automation_local_api_key is the key
browsers present to this service.
The service stores state in SQLite via AUTOMATION_DB_URL by default, which
local mode supports without a separate database role. Set
openhands_automation_database_url to a PostgreSQL URL to use one instead.
openhands_automation_kv_secret enables the automation key-value store and is
required for automations that persist state between runs.
openhands_automation_base_url is the externally reachable origin the service
appends /api/automation to when it builds callback URLs, so it must be the
origin the browser and the dispatched agent server side both use.
40.1 - Defaults
openhands_automation_user: openhands
openhands_automation_user_uid: 8154
openhands_automation_dir: /opt/openhands-automation
openhands_automation_home_dir: "{{ openhands_automation_dir }}/home"
openhands_automation_work_dir: "{{ openhands_automation_dir }}/work"
openhands_automation_state_dir: "{{ openhands_automation_dir }}/state"
openhands_automation_disk:
openhands_automation_packages:
- python3.12
- uv
openhands_automation_host: 127.0.0.1
openhands_automation_port: 18001
openhands_automation_version: "{{ undefined() }}"
openhands_automation_agent_server_version: "{{ undefined() }}"
openhands_automation_agent_server_url: "{{ undefined() }}"
openhands_automation_sandbox_agent_server_url: ""
openhands_automation_agent_server_api_key: "{{ undefined() }}"
openhands_automation_base_url: "{{ undefined() }}"
openhands_automation_local_api_key: "{{ undefined() }}"
openhands_automation_kv_secret: "{{ undefined() }}"
openhands_automation_database_url: "sqlite+aiosqlite:///{{ openhands_automation_state_dir }}/automations.db"
openhands_automation_workspace_base: "{{ openhands_automation_work_dir }}/automations"
openhands_automation_venv_dir: "{{ openhands_automation_dir }}/venv"
openhands_automation_service_path: /lib/systemd/system/openhands-automation.service
openhands_automation_env_path: "{{ openhands_automation_dir }}/.env"
openhands_automation_env:
PYTHONUTF8: "1"
OPENHANDS_REMOTE_WS_READY_REQUIRED: "false"
OPENHANDS_SUPPRESS_BANNER: "1"
openhands_automation_env_override: {}
41 - OpenHands canvas
Runs the OpenHands Agent Canvas browser client from the published npm package.
The service listens on loopback port openhands_canvas_port; TLS, the public
hostname, and routing to the agent server and automation API belong to the
deployment’s Traefik role.
The service runs the package’s scripts/static-server.mjs directly with Node,
an explicit loopback host, and the package’s build/ directory. It serves the
browser client without starting an agent server, an automation server, or the
npm launcher’s additional ingress process. Agent Canvas owns no conversation
or automation state and executes no tools.
The browser starts with no configured backend. The operator adds one with the canvas origin as the host and the agent server’s session key as the credential. The static server receives no session key and injects none into served assets. This configuration does not advertise an embedded VSCode editor.
The npm prefix is installed inside openhands_canvas_dir.
openhands_canvas_package_dir identifies the installed package containing the
static server and browser assets.
41.1 - Defaults
openhands_canvas_user: openhands
openhands_canvas_user_uid: 8153
openhands_canvas_dir: /opt/openhands-canvas
openhands_canvas_home_dir: "{{ openhands_canvas_dir }}/home"
openhands_canvas_work_dir: "{{ openhands_canvas_dir }}/work"
openhands_canvas_state_dir: "{{ openhands_canvas_dir }}/state"
openhands_canvas_package_dir: "{{ openhands_canvas_dir }}/lib/node_modules/@openhands/agent-canvas"
openhands_canvas_disk:
openhands_canvas_packages:
- nodejs24
- nodejs24-npm
openhands_canvas_host: 127.0.0.1
openhands_canvas_port: 8000
openhands_canvas_version: "{{ undefined() }}"
openhands_canvas_service_path: /lib/systemd/system/openhands-canvas.service
openhands_canvas_env_path: "{{ openhands_canvas_dir }}/.env"
openhands_canvas_env:
NODE_ENV: production
openhands_canvas_env_override: {}
42 - Openhands server
Runs the OpenHands agent server natively from a uv-managed virtual
environment. It hosts conversations, executes tools, and streams events for
Agent Canvas. The service binds loopback only; TLS and external reachability
belong to the calling deployment.
Set openhands_server_secure to true to require a session API key. The
unsecured mode omits the session key and is only appropriate where the loopback
boundary is trusted.
The caller can set openhands_server_install_packages to false and install
openhands_server_packages through its host-specific package workflow.
OSTree hosts use the shared dev_vm package entry point and must boot into a
deployment containing those dependencies before installing the service. They
also set openhands_server_service_path under /etc/systemd/system.
42.1 - Defaults
openhands_server_user: openhands
openhands_server_user_uid: 8152
openhands_server_dir: /opt/openhands-server
openhands_server_home_dir: "{{ openhands_server_dir }}/home"
openhands_server_work_dir: "{{ openhands_server_dir }}/work"
openhands_server_state_dir: "{{ openhands_server_dir }}/state"
openhands_server_conversations_dir: "{{ openhands_server_state_dir }}/conversations"
openhands_server_persistence_dir: "{{ openhands_server_state_dir }}/persistence"
openhands_server_workspace_dir: "{{ openhands_server_work_dir }}/project"
openhands_server_bash_events_dir: "{{ openhands_server_state_dir }}/bash_events"
openhands_server_tools_dir: "{{ openhands_server_dir }}/tools"
openhands_server_disk:
openhands_server_secure: true
openhands_server_install_packages: true
openhands_server_packages:
- python3.12
- uv
openhands_server_host: 127.0.0.1
openhands_server_port: 18000
openhands_server_version: "{{ undefined() }}"
openhands_server_session_api_key: "{{ undefined() }}"
openhands_server_secret_key: "{{ undefined() }}"
openhands_server_import_modules: canvas_ui_tool
openhands_server_vscode_port: 8001
openhands_server_vscode_base_path: /vscode
openhands_server_venv_dir: "{{ openhands_server_dir }}/venv"
openhands_server_venv_python: "{{ openhands_server_venv_dir }}/bin/python"
openhands_server_service_path: /lib/systemd/system/openhands-server.service
openhands_server_env_path: "{{ openhands_server_dir }}/.env"
openhands_server_env:
LOG_JSON: "true"
PYTHONUTF8: "1"
OPENHANDS_REMOTE_WS_READY_REQUIRED: "false"
OH_PERSISTENCE_DIR: "{{ openhands_server_persistence_dir }}"
OH_CONVERSATIONS_PATH: "{{ openhands_server_conversations_dir }}"
OH_WORKSPACE_PATH: "{{ openhands_server_workspace_dir }}"
OH_BASH_EVENTS_DIR: "{{ openhands_server_bash_events_dir }}"
OH_SECRET_KEY: "{{ openhands_server_secret_key }}"
43 - OS
43.1 - Defaults
os_hardening_enabled: true
44 - Posgresql
44.1 - Defaults
postgresql_packages:
- postgresql-server
- postgresql-contrib
postgresql_service: postgresql
45.1 - Defaults
pve_repo_keyring_path: /usr/share/keyrings/proxmox-archive-keyring.gpg
pve_repo_path: /etc/apt/sources.list.d/pve-install-repo.sources
pve_repo_keyring_url: https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg
pve_repo_keyring_checksum: "sha256:136673be77aba35dcce385b28737689ad64fd785a797e57897589aed08db6e45"
pve_snippets_dir: /var/lib/vz/snippets
pve_snippets: []
pve_repo_content: |
Types: deb
URIs: http://download.proxmox.com/debian/pve
Suites: trixie
Components: pve-no-subscription
Signed-By: {{ pve_repo_keyring_path }}
46 - PVE cluster
46.1 - Defaults
pve_cluster_remove_repos:
- pve-enterprise.list
- ceph.list
pve_cluster_add_repos:
- name: pve-no-subscription
value: deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
- name: ceph-squid
value: deb http://download.proxmox.com/debian/ceph-squid bookworm no-subscription
pve_cluster_node_config: []
pve_cluster_admins: []
pve_cluster_cluster_name:
pve_cluster_acme_accounts: []
pve_cluster_acme_plugins: []
pve_cluster_venv_dir: /opt/ansible/pve_cluster_venv
pve_cluster_venv_packages:
- pexpect
pve_cluster_base_image_dir: /var/lib/vz/template
pve_cluster_node_name: "{{ inventory_hostname | mandatory | split('.') | first }}"
pve_cluster_ceph_enabled: false
pve_cluster_ceph_repository: no-subscription
pve_cluster_ceph_osd: []
pve_cluster_ceph_pools: []
pve_cluster_ceph_mon: []
pve_cluster_ceph_mgr: []
pve_cluster_ceph_mds: []
pve_cluster_storages: []
pve_cluster_storage_config_path: /etc/pve/storage.cfg
47 - PVE VM
47.1 - Defaults
pve_vm_agent:
pve_vm_name: "{{ inventory_hostname }}"
pve_vm_delegate_update_known_hosts: localhost
pve_vm_delegate_pve:
pve_vm_set: "{{ pve_vm_set_default + pve_vm_set_additional }}"
pve_vm_set_default: []
pve_vm_set_additional: []
pve_vm_set_creation: "{{ pve_vm_set_creation_default + pve_vm_set_creation_additional }}"
pve_vm_set_creation_default: []
pve_vm_set_creation_additional: []
pve_vm_resize: []
pve_vm_venv_dir: "/opt/ansible/pve_vm_venv"
pve_vm_init_user:
pve_vm_venv_packages:
- proxmoxer
- requests
48 - PVE VM remove
48.1 - Defaults
49 - Raspberry pi
49.1 - Defaults
raspberry_pi_argon_enabled: false
raspberry_pi_containers_enabled: false
raspberry_pi_argon_eeprom_script_path: /usr/local/bin/argon_argon_eeprom.sh
raspberry_pi_argon_argon1_script_path: /usr/local/bin/argon_argon1.sh
raspberry_pi_cmdline_path: /boot/firmware/cmdline.txt
50 - Socket proxy
The socket listens on socket_proxy_listen and starts an unprivileged
systemd-socket-proxyd service when a client connects. The service forwards
the byte stream to socket_proxy_target. Supply both endpoints as addresses
with ports and set socket_proxy_name to the systemd unit basename.
The caller owns firewall policy and backend readiness.
Set socket_proxy_selinux_allow_http_ports on hosts that need the socket
proxy to bind or connect to TCP ports labeled http_port_t. The role
installs the policy before starting the socket on SELinux-enabled hosts.
The policy also lets systemd transition the unprivileged service into the
socket proxy domain with NoNewPrivileges enabled.
50.1 - Defaults
socket_proxy_name: "{{ undefined() }}"
socket_proxy_listen: "{{ undefined() }}"
socket_proxy_target: "{{ undefined() }}"
socket_proxy_selinux_allow_http_ports: false
51 - SSH
Normal setup installs fail2ban, installs the trusted user CA, creates missing
RSA, ECDSA and Ed25519 host keys, discovers and signs them, and invokes
devsec.hardening.ssh_hardening with those signed
certificate paths. The upstream role retains its native tasks and restart
handler.
Key creation preserves existing private keys. ssh_host_keys_dir defaults to
/etc/ssh and controls creation, discovery and upstream hardening. New RSA keys
use ssh_host_rsa_key_size (4096 bits by default), matching the hardening policy
before certificates are issued. The ssh_host_keys tag selects key creation
alone; upstream hardening retains its existing key-strength policy.
The ssh_hardening_match_user default supplies Match User ansible with
AllowTcpForwarding remote, PermitListen none, and
AllowStreamLocalForwarding remote through the upstream template. Set
ssh_hardening_match_user: [] to omit this match, or replace the list with
custom entries. The wrapper explicitly maps this variable to upstream
ssh_server_match_user; use the wrapper variable for inventory overrides.
Select normal SSH setup through the owning deployment’s ssh tag and an
explicit host limit, for example:
bazel run //infra/ingress/ansible:ansible -- \
--limit host1.ingress.alwaldend.com --tags ssh
This uses the owner’s authentication and runs the full SSH setup described
above, including the native restart handler. The ssh_hardening tag alone
skips the required certificate discovery. The upstream template validates its
candidate during apply; --check --diff previews do not validate the proposed
configuration. The scanner does not invoke this role or change server policy.
Replacing a signed host certificate notifies a role-owned handler. It runs
sshd -t before reloading the daemon so new connections receive the renewed
certificate even when the hardening configuration is unchanged. The service
name follows sshd_service_name when provided, otherwise the OS-family default.
Existing sessions survive the reload. This is deployment-time renewal; the role
does not install a certificate renewal timer.
51.1 - Defaults
ssh_hardening_enabled: true
ssh_host_keys_dir: /etc/ssh
ssh_host_rsa_key_size: 4096
# Set to [] to omit the shared Match User default.
ssh_hardening_match_user:
- user: ansible
rules:
- AllowTcpForwarding remote
- PermitListen none
- AllowStreamLocalForwarding remote
ssh_vault_mount: ssh/servers
ssh_vault_role: "{{ undefined }}"
ssh_sign_ignore_errors: false
ssh_valid_principals: []
52 - SSH port forwarding
52.1 - Defaults
ssh_port_forward_local_addr: 127.0.0.1
ssh_port_forward_script_path: /usr/local/bin/ssh-port-forward
53 - SSH update known hosts
53.1 - Defaults
ssh_update_known_hosts_hosts: []
54 - T3 Code
The default npm installation mode retains the npm launcher. Callers can
select t3code_install_method: standalone and supply t3code_archive_src,
a controller-side archive whose integrity is verified by the caller’s Bazel
repository. The role transfers the archive without downloading it on the host. The role installs the complete official bundle under an
administrator-owned release directory and invokes its executable directly.
State, work, and home remain owned by the ordinary T3 service account.
Archive comparison repairs missing or incomplete bundle files on reapplication;
the existence of the executable alone does not skip extraction.
Standalone mode uses native T3 pairing/session authentication and omits the
legacy npm mode’s T3CODE_AUTH_TOKEN environment entry.
Changed runtime, environment, or service inputs restart T3 Code. An unchanged
run ensures the service is started. Token-bearing environment writes are
excluded from Ansible logs. Optional t3code_initial_settings seeds first
startup without overwriting later UI settings. Deployment and provider setup
remain the caller’s responsibility.
54.1 - Defaults
t3code_user: t3code
t3code_user_uid: 8151
t3code_dir: /opt/t3code
t3code_home_dir: "{{ t3code_dir }}/home"
t3code_work_dir: "{{ t3code_dir }}/work"
t3code_disk:
t3code_port: 5120
t3code_version: "{{ undefined() }}"
t3code_state_dir: "{{ t3code_dir }}/state"
t3code_auth_token: "{{ undefined() }}"
t3code_service_path: /lib/systemd/system/t3code.service
t3code_env_path: "{{ t3code_dir }}/.env"
t3code_env: {}
t3code_install_method: npm
t3code_archive_src: "{{ undefined() }}"
t3code_release_dir: "{{ t3code_dir }}/releases/standalone"
t3code_bin_path: "{{ t3code_release_dir }}/t3"
t3code_initial_settings: {}
55 - Traefik
The administrator owns the proxy directory, configurations, TLS inputs, binary,
and unit. The service account can write only its data and log directories;
custom configuration and executable paths must have administrator-owned
ancestors and stay outside those writable directories. Static configuration
can contain credentials and is installed with mode 0640.
Both rendered configurations pass controller-side TOML/YAML syntax validation before installation. Startup inputs (static configuration, binary, trust CA, Basic Auth verifier, and unit) restart the service only when changed. Dynamic routing uses Traefik’s file watcher. Unchanged runs keep the process running; the unit has no SIGHUP reload action. Syntax validation does not prove route semantics or external issuer reachability.
Installation retains temporary backups. If staging or startup fails, available prior files are restored and a previously active service is restarted before the play reports failure. A first installation has no previous deployment to restore. Failed recovery preserves its backups; successful activation or recovery removes them. This covers startup rejection, not failures after a successful startup or invalid dynamic routing accepted by the process.
Local ACME enrollment is cached in administrator-only eab.json (mode 0600).
The Vault request runs on the controller without privilege escalation; cache
installation runs on the managed host with its declared administrator ownership.
Unchanged deployments reuse it without issuing another Vault request. The first
upgrade creates the cache once. Changing the issuer path or setting
traefik_rotate_eab: true requests a new binding; reset the flag afterwards.
If the ACME account state is lost, rotate its single-use enrollment binding
before re-enrolling. Keep the cache and ACME account data private.
Basic Auth
Set traefik_basic_auth_src to the controller-side verifier file and use
traefik_basic_auth_path as usersFile in the dynamic configuration. The
role installs the verifier with mode 0640 and restores it with the other
startup inputs if activation fails.
Prometheus metrics
Configure the Prometheus entry point in the deployment’s static Traefik configuration. Use the role’s default metrics port, 9100, and configure the host firewall to allow the collector.
55.1 - Defaults
traefik_user: traefik
traefik_no_user: false
traefik_owner: root
traefik_user_uid: 3578
traefik_dir: "/opt/traefik"
traefik_log_dir: "{{ traefik_dir }}/logs"
traefik_data_dir: "{{ traefik_dir }}/data"
traefik_tls_dir: "{{ traefik_dir }}/tls"
traefik_basic_auth_src: null
traefik_basic_auth_path: "{{ traefik_tls_dir }}/basic-auth.htpasswd"
traefik_disk:
traefik_mtls_ca_local_path: "{{ role_path }}/files/traefik_mtls_ca.crt"
traefik_mtls_ca_path: "{{ traefik_tls_dir }}/mtls_ca.crt"
traefik_acme_path: "{{ undefined }}"
traefik_config_dir: "{{ traefik_dir }}/configs"
traefik_config_path: "{{ traefik_config_dir }}/traefik.toml"
traefik_disable_eab: false
traefik_config_local_path: "files/traefik.toml"
traefik_dynamic_config_path: "{{ traefik_config_dir }}/traefik_dynamic.toml"
traefik_dynamic_config_local_path: "files/traefik_dynamic.toml"
traefik_service_path: "/lib/systemd/system/traefik.service"
traefik_service_scope: system
traefik_bin_local_path: "{{ role_path }}/files/traefik"
traefik_bin_path: /usr/bin/traefik
traefik_vault_bin_local_path: "{{ role_path }}/files/vault"
traefik_eab_cache_path: "{{ traefik_config_dir }}/eab.json"
# Rotate explicitly after losing an ACME account or its enrollment state.
traefik_rotate_eab: false
traefik_metrics_port: 9100
56 - Traefik (old)
56.1 - Defaults
traefik_user: traefik
traefik_user_uid: 3653
traefik_env: {}
traefik_data_dir: /mnt/traefik
traefik_log_dir: "/var/log/traefik"
traefik_certificates_dir: "{{ traefik_data_dir }}/certificates"
traefik_configs_dir: "{{ traefik_data_dir }}/configs"
traefik_configs_version: "{{ lookup('ansible.builtin.pipe', 'git rev-parse HEAD') }}"
traefik_configs_dynamic_dir: "{{ traefik_configs_cur_dir }}/dynamic"
traefik_configs_dynamic_dir_symlink: "{{ traefik_configs_symlink }}/dynamic"
traefik_configs_cur_dir_name: "{{ traefik_configs_version }}"
traefik_configs_cur_dir: "{{ traefik_configs_dir }}/{{ traefik_configs_cur_dir_name }}"
traefik_configs_symlink: "{{ traefik_configs_dir }}/current"
traefik_static_config_path: "{{ traefik_configs_symlink }}/traefik.yaml"
traefik_releases_dir: /opt/traefik/releases
traefik_static_config:
traefik_dynamic_configs: []
traefik_release_version: v3.3.1
traefik_release_dir_name: "{{ traefik_release_version }}"
traefik_release_dir: "{{ traefik_releases_dir }}/{{ traefik_release_dir_name }}"
traefik_release_symlink: "{{ traefik_releases_dir }}/current"
traefik_release_symlink_bin: "{{ traefik_release_symlink }}/traefik"
traefik_release_archive_name: "traefik_{{ traefik_release_version }}_linux_amd64"
traefik_release_archive_full: "traefik_{{ traefik_release_version }}_linux_amd64.tar.gz"
traefik_release_bin_path: "{{ traefik_release_dir }}/traefik"
traefik_release_download_url: "https://github.com/traefik/traefik/releases/download/{{ traefik_release_version }}/{{ traefik_release_archive_full }}"
traefik_release_download_checksum: sha256:27fd502a8d80fc81b97faf5cebd7a1cbc1a2c5369d18e0f4471a66d1a8c139ce
57 - Update all packages
This role owns immediate package updates and native automatic updates. The
shared host role imports it once.
Immediate updates refresh metadata and update installed packages on modern systemd DNF4, DNF5 and APT hosts. APT refuses transactions requiring package removal. Holds, exclusions, repository choices and version locks remain in effect. Package-manager Python bindings must already be installed; automatic binding installation is disabled for APT and DNF5. Legacy appliances such as XCP-ng require their owning maintenance workflow.
The /run/ostree-booted marker takes precedence over DNF facts. OSTree upgrades
use the pinned ansible.posix.rpm_ostree_upgrade module to prepare a deployment
for the next boot, without live application. Prepared fixes are not necessarily
active until a later authorized reboot.
An already running native staging transaction is allowed to finish before the
immediate upgrade starts; the role waits for up to 30 minutes and never cancels it.
Controls and tags
update_all_packages_upgrade_enableddefaults totrue. Set it tofalseto use the normal role for automatic-update configuration only; immediate upgrades, reboot detection, and the explicit reboot task are skipped.update_all_packages_reboot_enabled: falseis the default. A reboot occurs only when explicitly enabled and the backend reports it is required.update_all_packages_automatic_enableddefaults totrue. Set it tofalseto disable native automatic updates. It never enables automatic reboots.- The
update_all_packagestag runs the complete role. - The
automatic_updatestag configures native automation without an immediate upgrade or reboot.
Use the normal role entry point with these controls. Backend selection happens once; task files are internal implementation and are not standalone APIs.
Reboot detection uses dnf needs-restarting -r, dnf5 needs-restarting, the
Debian /var/run/reboot-required marker, or the first OSTree deployment’s boot
state. update_all_packages_reboot_required records the result. DNF exit codes
0 and 1 mean no reboot and reboot required; other failures remain failures.
The native DNF reboot-hint command must already be installed.
Native automatic updates
The role uses native packages (dnf-automatic,
dnf5-plugin-automatic, unattended-upgrades), configuration paths and systemd
timers. DNF selects security advisories; APT retains its packaged allowed
origins. No custom timer or cron job is created. Other vendor settings remain
intact. Disabling automatic updates stops and disables installed native
installation timers without installing a missing updater package. DNF opt-out
covers the generic DNF4 timer, its install-only variant, and the DNF5 timer,
including timers left behind when the selected updater package is absent.
Native download-only and notification timers remain unchanged. Already running
update services are allowed to finish; stopping a timer does not cancel a transaction.
OSTree uses AutomaticUpdatePolicy=stage and
rpm-ostreed-automatic.timer, retaining other daemon settings. Changed policy
is reloaded before the timer is enabled. Disabling sets policy none and stops
the timer. This backend stages complete deployments, not security-only updates.
DNF reboot=never and APT Automatic-Reboot=false are explicit. Before enabling
timers, the role inspects native service commands and systemd actions for
separate reboot/shutdown hooks, including Cockpit overrides, and fails with an
actionable message when found. It does not replace unrelated administrator
overrides or cancel a previously scheduled reboot. Arbitrary external automation
still requires a host audit. Package scripts may restart services even when
host reboots are disabled.
Inspect the native timer state, effective configuration, update service journal, pending packages/deployments and unchanged-run results during E2E verification. Enabling a timer proves scheduling, not a successful future transaction.
57.1 - Defaults
# Reboot only when explicitly enabled and the backend reports it is required.
update_all_packages_reboot_enabled: false
# Allow configuration-only callers to use the normal role entrypoint.
update_all_packages_upgrade_enabled: true
# Enable native automatic security updates by default (staged updates on OSTree).
# This never enables automatic reboots, even when immediate reboots are enabled.
update_all_packages_automatic_enabled: true
58 - Users
58.1 - Defaults
users_regular: {}
users_remove: {}
users_admins:
ansible:
name: ansible
disable_passwd: true
sudo_no_passwd: true
users_ssh_keys: {}
59 - Vault
59.1 - Defaults
vault_user: vault
vault_time_server: time.cloudflare.com
vault_user_uid: 3123
vault_dir: "/opt/vault"
vault_data_dir: "{{ vault_dir }}/data"
vault_raft_dir: "{{ vault_dir }}/raft"
vault_config_dir: "{{ vault_dir }}/configs"
vault_config_path: "{{ vault_config_dir }}/vault.hcl"
vault_config_local_path: "files/vault.hcl"
vault_log_dir: "{{ vault_dir }}/logs"
vault_tls_dir: "{{ vault_dir }}/tls"
vault_service_path: "/lib/systemd/system/vault.service"
vault_tls_client_ca_file_local_path: files/tls_client_ca_file.pem
vault_tls_client_ca_file_path: "{{ vault_tls_dir }}/tls_client_ca_file.pem"
vault_tls_cert_file_path: "{{ vault_tls_dir }}/tls_cert_file.pem"
vault_tls_key_file_path: "{{ vault_tls_dir }}/tls_key_file.pem"
vault_tls_issue_path:
vault_tls_alt_names: ""
vault_bin_local_path: "{{ role_path }}/files/vault"
vault_bin_path: /usr/bin/vault
vault_peers_write: false
vault_peers_local_path:
vault_peers_remote_path: "{{ vault_raft_dir }}/raft/peers.json"
60 - Vault server certificate
Use alwaldend.main.vault_server_certificate to obtain a certificate from
Vault PKI for a managed host’s existing private key. The role retains a trusted
certificate for the configured name while it has at least seven days remaining.
When renewal is needed, the role sends a signing request to Vault from the
Ansible controller, verifies the returned certificate, and installs it on the
host. The private key stays on the managed host.
Supply the Vault PKI signing path, certificate path, private key path, and
service group. The role uses the play’s date_time fact, the host’s CA trust,
and the Vault connection and token injected on the controller. Set
vault_server_certificate_notify to a handler when the service needs to reload
or restart after a certificate change.
60.1 - Defaults
vault_server_certificate_sign_path: "{{ undefined() }}"
vault_server_certificate_path: "{{ undefined() }}"
vault_server_certificate_key_path: "{{ undefined() }}"
vault_server_certificate_group: "{{ undefined() }}"
vault_server_certificate_name: "{{ inventory_hostname }}"
vault_server_certificate_ttl: 720h
vault_server_certificate_notify: []
61 - VictoriaMetrics role
The alwaldend.main.victoria_metrics role installs and configures the
VictoriaMetrics single-node service on a systemd host. Run it with privilege
escalation and set victoria_metrics_binary_src to the executable path on
the Ansible controller.
Set victoria_metrics_dashboard_src to a VMUI dashboard JSON file on the
controller to enable a predefined dashboard. VMUI reads the installed JSON
when its dashboard view loads, so edits to the JSON take effect on reload.
The service binds to loopback and retains data for 30 days. To configure
scrape jobs, set victoria_metrics_scrape_config_src to a YAML template on
the Ansible controller.
61.1 - Defaults
victoria_metrics_binary_src: "{{ undefined() }}"
victoria_metrics_dashboard_src: ""
victoria_metrics_scrape_config_src: scrape.yaml.j2
62 - Wireguard
62.1 - Defaults
wireguard_dir: "/etc/wireguard"
wireguard_local_config_paths: []
63.1 - Defaults
xray_enabled: false
xray_config_dir: /usr/local/etc/xray
xray_log_dir: /var/log/xray
xray_config_path: "{{ xray_config_dir }}/0-main.json"
xray_client_id:
xray_wireguard_relays: []
xray_wireguard_ipv4_address:
xray_wireguard_ipv6_address:
xray_wireguard_private_key:
xray_config:
xray_configs: {}
xray_user: xray
xray_socket_dir: /var/shm/xray
xray_caddy_config_path: /etc/caddy/configs/xray.Caddyfile
xray_subscriptions_dir: /usr/local/etc/xray-subscriptions
xray_caddy_user: caddy