Shared foundation for the tvdinner collection family — reusable Ansible for self-hosting.
tvdinner.core.servicerole — manage a self-hosted Docker service on a StumpCloud node: container, networks, caddy vhost, backups wiring.tvdinner.core.baserole — birthright automation every node gets: packages, DNS registration (base_manage_dns), unattended security upgrades, users. Included bynode; usable on its own.tvdinner.core.noderole — node baseline:baseplus docker, users, storage, swap, caddy, edge hardening, self-healing.
The roles call into amazon.aws, ansible.posix, community.docker,
community.general, community.hashi_vault, community.mysql and
community.postgresql (declared as dependencies in galaxy.yml), and
expect the StumpCloud inventory shape (dns.wtf, vault_conn, paths.local,
tz, smtp, aws.letsencrypt); see each role's defaults/main.yaml.
plugins/module_utils— the sharedRESTClientand helpers everytvdinner.*API collection builds on. One client instead of seven bespoke copies: URL joining, query params, JSON handling, timeout, TLS verification, token/bearer/basic/header auth, structured errors, and a check-mode-safe diff helper.
from ansible_collections.tvdinner.core.plugins.module_utils.client import (
AUTH_TOKEN, RESTClient)
from ansible_collections.tvdinner.core.plugins.module_utils.common import (
client_from_module, connection_argument_spec)
class GiteaClient(RESTClient):
def __init__(self, url, token, **kwargs):
super(GiteaClient, self).__init__(url, token, auth_style=AUTH_TOKEN, **kwargs)
def get_user(self, username):
return self.request('GET', '/api/v1/users/{0}'.format(username))Modules get their connection options from
connection_argument_spec('gitea_url', 'gitea_token') and build the client
with client_from_module(module, GiteaClient, 'gitea_url', 'gitea_token').
ansible-galaxy collection install git+https://gitea.stump.rocks/tvdinner/ansible-collection-core.gitmake check # lint + test
make molecule # converge tvdinner.core.base in a Debian 12 container (Docker)MIT