Repository navigation
Releases
Releases · NoiXdev/ansible-collection-infra
v0.6.0
portainer: an agent registers itself as an environment on a Portainer server. Set
portainer_agent_register_url(the server, e.g.https://portainer.example.com) and
portainer_agent_register_api_token(an access token; the run fails before any change when it is
empty);portainer_agent_register_addresspins the URL's host name to an address (curl
--resolve, IPv6 allowed, TLS is still verified),portainer_agent_register_name(default the
inventory host name) names the environment andportainer_agent_register_endpoint(default the
firstportainer_agent_bindaddress, port 9001) is where the server dials the agent. The
environment is matched by exact name: missing is created (retried while the agent starts), the
same name with the same endpoint is left alone, and the same name with another endpoint fails
the run naming both and changes nothing. Nothing is created in check mode. The token only lives
in a temporary 0600 header file that curl reads and that is removed afterwards, never on a
command line or in the output. An existing environment of another name for the same agent is
not detected (the match is by name only). Removing or editing environments is not handled; the host needs
curl (thebaserole installs it).tailscale: the first login gives up aftertailscale_login_timeoutseconds (default 120)
instead of waiting forever. The run then fails with whattailscale upreported or, when the
tailnet requires device approval, names the node to approve in the admin console. The auth key
file is removed either way.- Releases are cut by the
releaseworkflow (Actions tab,bumppatch, minor or major,dry_run
on by default): it checks main, CI, the signed test run and the changelog, then bumps
galaxy.ymlandCHANGELOG.md, tagsvX.Y.Z, publishes the release, updates the README
install example and announces it on Discord. The steps by hand stay inCONTRIBUTING.md. nginx: new role that installs nginx of one stable series from nginx.org (nginx_version, a
quotedmajor.minorsuch as"1.30"; Ubuntu 24.04 and 26.04, any other release is refused
before any change) and serves the sites ofnginx_sites, the complete list: a site that leaves
it loses its config, while its web root, logs and certificate stay. An apt pin keeps nginx in the
series and Ubuntu's nginx packages out; the nginx.org origin joins unattended-upgrades. An
installed nginx of another series, or Ubuntu's, is refused before any change. A site is a PHP
site (php_pool, fastcgi to/run/php/<pool>.sock; onlyphp_front_controllerand
php_scriptsrun, any other.phpfile answers 404), a proxy site (proxy, with WebSocket
upgrades) or a static site;www-datajoins each site's group, so web roots must be
group-readable. TLS isletsencrypt(certbot,nginx_acme_email, HTTP-01 through a webroot,
renewals reload nginx),off, or{cert, key}with OCSP stapling throughnginx_resolvers
(127.0.0.53, so other hosts than systemd-resolved ones set it). Global hardening: TLS 1.2 and
1.3 with Mozilla's intermediate ciphers,server_tokens off, and a default server that closes
the connection for an unknown host name. Per site: security headers and HSTS, 404 for dotfiles,
composer.jsonand dumps (hardening),rate_limitzones (answer 429),basic_authwith an
allowlist (nginx_real_ip_fromfor trusted proxies; the controller needs passlib),headers
andextra. Every config change is tested withnginx -tbefore nginx reloads, and a config
nginx rejects is put back. The noix error pages (nginx_error_pages, on by default, so the host
needs Docker unless it setsfalse) answer nginx's own errors only; an app's own error pages
pass through. A site withanubis: trueis checked by theanubisrole in host mode on
127.0.0.1:nginx_anubis_port(keep it equal toanubis_host_port); a site cannot have both
anubisandbasic_auth, and 401 must not be amongnginx_error_pages_codeswhile a site has
Anubis. Deploy snippets (user_includes,nginx_user_includes,nginx_include_user) are not
supported yet and are refused.nginx_ipv6ignores link-local addresses.nginx: a link is followed only to a file of its own owner in every part of a path, the web
root's own path too (disable_symlinks if_not_ownerwithoutfrom=): a site user's link in its
root path (a deploy'scurrent) re-pointed at another site's tree is not served. A deploy's
current -> releases/Nworks when the site user owns both; a root reached through a link of one
owner to another owner's tree is not served, so use the real path or a link of the same owner.nginx: the global config (nginx.conf, the default server, the hardening) is written and
tested with the site configs in onenginx -t, and put back with them when nginx rejects the
config: a rate limit zone or annginx_http_extradefinition leaves in the same run as the site
that stops using it.nginx: a Let's Encrypt certificate whose renewal config names another ACME server than
nginx_acme_serveris reissued fromnginx_acme_serveron the next run, so a switch from
Let's Encrypt's staging directory to production replaces the staging certificates.nginx: hardened sites also answer 404 for compressed dumps and backups (*.sql,*.bakand
*.swpwith.gz,.bz2,.xz,.zst,.zip,.7z,.lz4or.lzma, in any case).nginx: a site with the user or groupwww-data, or with a privileged group (root,sudo,
admin,wheel,adm,shadow,disk,kmem,docker,lxd,incus-admin,libvirt,
systemd-journal), is refused before any change:www-datajoins a site's group, so every
nginx worker would get it.nginx: a failed certificate request says what each site serves until a run gets it: a site
with a certificate keeps its TLS block, a site without one (new, or switched toletsencrypt)
only its HTTP block, the ACME challenges and a redirect to HTTPS, none of its content.anubis: new modehostfor an nginx on the host itself (thenginxrole's sites with
anubis: true): the container publishes127.0.0.1:anubis_host_port(8923) only and joins none
of the other modes' networks. One mode per host.php: new role that installs PHP versions from the ondrej/php PPA (Ubuntu 24.04 only for now; any
other release is refused before any change) and runs every pool inphp_poolsas a PHP-FPM
master of its own (php-fpm@<name>, socket/run/php/<name>.sockwithout a version in it,
owned by the pool user andphp_fpm_listen_group). A config change reloads only that pool, a
version change restarts only that pool. Each pool has/php-fpm-ping(pong) and
/php-fpm-status.php_poolsis the complete list: a pool that leaves it is stopped and its
config removed; itstmp_dirand log stay. Versions that leavephp_versionsstay installed,
with theirphp<v>-fpmservice stopped. Withphp_fpm_per_pool_service: false(classic mode)
the pools run in the packages'php<v>-fpmservices instead, and switching moves every pool.
Poolenvvalues starting with$are refused (FPM would expand them), a changed socket owner
or listen group restarts the pool, and a config FPM rejects never replaces a running one: it is
tested before anything is switched. Poolenvandinivalues never appear in the run's output.
A pool with group root (gid 0) and pool names longer than 64 characters are refused before any
change.tmp_dirand itssession,uploadandsysdirs are created without following
links (the three dirs as the pool user): a link intmp_diror its path stops the run, naming
it. A run that fails after a change, for example on a typo in one version's extensions, still
reloads or restarts the pools for what it changed before it fails. Ubuntu'sphp<v>-*
packages are pinned to -1 and the PPA preferred, so a run that cannot reach the PPA never
installs Ubuntu's PHP. The PPA joins
unattended-upgrades in both modes; with one master per pool an apt hook restarts the pools of
each version with an upgradedphp<v>-*package (extensions too) one at a time
(/usr/local/sbin/php-fpm-rolling-restart). Each restart is bounded by
php_fpm_restart_timeout; a pool that does not come back stops the rolling restart (see
journalctl -t php-fpm-rolling-restart) while apt still succeeds. needrestart, installed by
default on Ubuntu servers, is told to leave thephp-fpm@pools to that hook
(/etc/needrestart/conf.d/50noixdev-php-fpm.conf) instead of restarting them all at once. In
classic mode the package's own restart applies, needrestart's included.composer: new role that installs Composer as/usr/local/bin/composerfrom the official phar
at an exact version (composer_version) checked against a pinned SHA-256 (composer_sha256,
from getcomposer.org's.sha256sum; a wrong checksum leaves the installed Composer alone),
Composer 1 as/usr/local/bin/composer1withcomposer1_enabled, and~/.config/composer/auth.json
for the users incomposer_auth(mode 0600, written as the user, content never printed). The role
owns the whole file;state: absentremoves it. A user listed twice, an unknown user and a
presententry withoutauthare refused. It needs aphpon the host and installs
ca-certificates.portainer,traefik,dashy,pulsix_manager,pulsix_worker,dns,harbor,listmonk,
anubisandmailcowcheck for Docker first, before they change anything: thedockerCLI,
the compose plugin (docker compose version) and a daemon that answers (docker version).
Without them the run fails with "Docker is not installed or not running on ; run
noixdev.infra.docker (or install Docker with the compose plugin) before " and the reason,
instead of a module error later in the role. The r...