Skip to content

Managing hosts and secrets

Add gateways to hosts.yml, following an existing gateway entry such as brunsbach. Place service hosts in their existing groups:

  • services_map for the map stack (batman, batctl, grafana_public, meshviewer)
  • services_web for the web stack (batman, batctl, node_exporter, website, firmware_release, firmware_selector, fail2ban, unattended_upgrades)
  • dns for the standalone DNS host

Keep shared configuration in group_vars/ and host-specific configuration in host_vars/. Encrypt secrets with Ansible Vault; do not put plaintext credentials in inventory or documentation.

Map and web hosts use the fastd_client role rather than the gateway fastd role. The role manages shared Fastd client configuration, bat0 startup/address settings, the gateways peer repository, and one generated or preserved Fastd key. Gateway routing, NAT, policy routing, and predefined peer verification remain in the gateway role.

For a fresh web host, follow the web host restoration procedure. The exact CI repository and workflow names, plus the manual firmware signature check, remain explicitly marked for completion.

Register the deployment key with the local SSH agent:

Terminal window
ssh-add "$keyfile"

If SSH reports a host-key issue, connect interactively and verify the host fingerprint before accepting it:

Terminal window
ssh root@<gateway-host>

The SSH role adds the current maintainer keys and removes explicitly listed revoked keys from root’s authorized_keys. It leaves other keys, including cloud-init keys, in place. The revoked public-key files are retained so those exact keys can be removed; other keys belonging to a former maintainer must be identified separately.

Create or edit an encrypted host-vars file with the fastd_key vault ID:

Terminal window
ansible-vault create --vault-id fastd_key@prompt "host_vars/$gatewayname.yml"
ansible-vault edit --vault-id fastd_key@prompt "host_vars/$gatewayname.yml"

Only add variables required by the host’s roles. See WireGuard exit configuration for the host variables used by the optional Mullvad WireGuard setup.