Files
monky-deployd/ansible/roles/monky_deployd/README.md
T
mdella 6336012b74 feat(install): read-only deploy token for the private package registry (v0.1.2)
The GitLab project is private (its parent groups are private, so it cannot be
made public): the v0.1.1 one-liner answered 401 anonymously. install.sh gains
--token / MONKY_DEPLOYD_TOKEN and sends `DEPLOY-TOKEN: <token>` (a GitLab deploy
token, scope read_package_registry only, revocable) on every registry download,
the script itself included; the token goes through a 0600 curl -K file (never the
command line, the log or an xtrace). The grant is taken via --bootstrap-file when
the script is piped (stdin IS the script). Ansible: monky_deployd_download_token
(vaulted) -> DEPLOY-TOKEN header, no_log. Docs explain why, the token's scope and
the --source gitea alternative (split-horizon Gitea, cbs/iac#102).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KLB7jieMNRkTsJ2epr4Ds1
2026-09-05 19:03:25 +00:00

2.4 KiB

role monky_deployd

Installs and configures monky-deployd (the Monky backend pull agent, MONKY-ADR-0028) on a docker host that already carries an enrolled host identity (roles/ziti_tunneler, run-host mode). Skeleton for osg1-07; copy it there.

What it does: pin + download the .deb from the scm.tikali.ai package registry (sha256 verified; the project is private, so the fetches send the read-only deploy token monky_deployd_download_token as DEPLOY-TOKEN, no_log; monky_deployd_base_url/_deb_url switch to the Gitea release off-estate) → ACL u:monky-deployd:r on the identity (rx on the dir) → /etc/monky-deployd/config.yaml from the template → optional openbao-ca PEM → optional monky-deployd-proxy.service (transport: proxy) → the one-time bootstrap deploy grant from a vault var (0600, no_log) → monky-deployd.timer → first tick via handler (inside the grant's hour) → monky-deployd status.

Variables (see defaults/main.yml)

var note
monky_deployd_version pinned release, e.g. 0.1.2
monky_deployd_download_token vaulted: GitLab deploy token, scope read_package_registry only (revocable) — the registry is private; seeded in OpenBao at monky/monky-tenancy/deployd-download key token (path/key are the operator's choice). Empty = no header (only works with the Gitea base_url)
monky_deployd_env_id / _site / _transport per host (env-dev-06, cbs, sdk)
monky_deployd_bootstrap_grant tenancy-minted deploy grant (1 h) — ansible-vault or a lookup at play time; empty keeps the existing token
monky_deployd_bao_ca_pem the openbao-ca certificate (PEM)
monky_deployd_volumes_on_absent keep (default) or purge (never applied on prod by the agent)

Example play

- hosts: env-dev-06:env-dev-07:env-dev-08:env-dev-09
  become: true
  roles:
    - role: ziti_tunneler        # enrol/verify monky-host.<env>; gains the ACL var + name assertion
    - role: monky_deployd
      vars:
        monky_deployd_bootstrap_grant: "{{ lookup('pipe', 'tenancy-mint-grant ' ~ inventory_hostname) }}"
        monky_deployd_download_token: "{{ vault_monky_deployd_download_token }}"   # ansible-vault / OpenBao lookup

Rollout order (plan §E): pilot env-qa-02 → env-dev-06..09 → env-dev-01 last (after its live key moves into Bao). Verified on Ubuntu 26.04.