Skip to content

Converge owned PostgreSQL databases with their role and password (S-006-5, 6, 7, 12, 13) #122

Closed

Description

@shipmill-romamo

Builds part of spec S-006, docs/specs/006-standalone-postgresql.md (feature issue #81): the acceptance criteria below. Each needs a test that names its id (test_s006_<k>_..., or a proves: S-006-5 comment line).

This is the services converge for an owned database: the role, its password from passwordRef, backups, and data copy.

  • S-006-5: After services.yml converges the service of S-006-1, pg_roles holds billing with rolcanlogin and a SCRAM-SHA-256 password, and database billing is owned by billing
  • S-006-6: The password value appears in none of the rendered inventory, the playbook output, the command's answer, or any receipt, and the answer names the reference, the key, and the value's SHA-256
  • S-006-7: A passwordRef whose file or key is missing stops the services converge with PRECONDITION naming the expected path and key, and no playbook runs
  • S-006-12: For the project in config/examples, cloudfall-engine inventory render writes a byte-identical inventory before and after the change, and the rendered cloudfall.conf, nftables.conf, backup script, and restore-check script are identical
  • S-006-13: For the service of S-006-1, the backup script writes billing-<timestamp>.dump, the restore drill restores it and passes, and cloudfall data copy <service> --database billing --source-url-file <file> --yes restores as role billing and writes a receipt with spec.owner of billing

Depends on #121

Activity

  1. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Triage: implement, for the next release candidate.

    The plan: build the criteria listed in the body, as docs/specs/006-standalone-postgresql.md (S-006, approved in #101) says, each with a test that names its id. A departure from a criterion goes back as a question, never a quiet change. Build issues start in order: this one starts once every issue on its Depends on lines has closed. I'll link the PR here.

  2. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    PR #139 makes services.yml create the owner login role, set its SCRAM password from passwordRef on every converge, and make it own the database. Every path that runs it reads --secrets-dir, stages the value in a 0600 file outside the project for the run only, and keeps it out of inventory, output, answers and receipts; a missing file or key is PRECONDITION before any playbook. Example renders are pinned byte for byte (S-006-12). I asked it to also name the reference, key and SHA-256 in the operator's answer before it lands.

    Trade-off: pg_roles, a real dump, the drill, and pg_restore --role on a live PostgreSQL host (S-006-5, S-006-13) aren't exercised; tests cover the task logic and the data copy receipt's spec.owner.

  3. shipmill-romamo commented on Oct 27, 2026

    @shipmill-romamo
    ContributorAuthor

    Released in v0.8.0rc7 (pre-release). uv tool install --prerelease allow cloudfall==0.8.0rc7
    A plain install gets it with the next stable release.
    If you filed this: react 👍 on this comment once it works for you, or reply if it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions