Skip to content

[REVIEW] Ansible: salt_master re-applies ACL + restarts salt-api on already-provisioned master (#659)#660

Merged
hellodk merged 1 commit into
masterfrom
feat/salt-master-role-reapply
Jun 9, 2026
Merged

[REVIEW] Ansible: salt_master re-applies ACL + restarts salt-api on already-provisioned master (#659)#660
hellodk merged 1 commit into
masterfrom
feat/salt-master-role-reapply

Conversation

@hellodk

@hellodk hellodk commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Closes #659. Awaiting DK review — do not auto-merge. Lets the already-provisioned mm1 receive the #641 salt-api external_auth ACL via Ansible become (sudo over SSH), no manual operator sudo.

Changes (external Principal Ansible engineer)

  • tasks/configure.yml — kri.conf change now notifies both Restart salt-master and Restart salt-api (external_auth needs a master restart to take effect; salt-api shares the eauth).
  • tasks/verify.yml (new, imported last in main.yml) — wait_for 4505 (master) + salt_api_port (salt-api), then a POST /login readiness probe asserting HTTP 200 + token (proves the ACL/eauth is live). Skippable via -e salt_api_verify=false.
  • README.md (new) — runbook: sudo/become prerequisite, exact re-apply command, variable table, ACL-sync note.
  • 20 source-contract tests; all role YAML parses; ruff clean. (ansible-lint not in the venv — not run.)

Re-apply command (from the README)

scripts/kri saltmaster install 192.168.1.64 — or ansible-playbook playbooks/deploy_salt_master_mm1.yml -i playbooks/inventory/hosts.ini -e "kri_salt_api_password=<pw>"

Please confirm in review (expert's flagged assumptions)

  1. Passwordless sudo on mm1's dk account (else use --ask-become-pass).
  2. kri_salt_api_password supplied at run time for the /login probe (or -e salt_api_verify=false).
  3. Linux parity out of scope — handlers are macOS/launchctl only; mm1 is macOS. Linux systemd dual-notify can follow if needed.

🤖 Generated with Claude Code

…ster with verification (#659)

So an already-provisioned macOS master (mm1) can have the #641 external_auth
ACL applied via `become` (sudo over SSH) with no manual operator sudo:
- configure.yml: kri.conf change now notifies BOTH Restart salt-master AND
  Restart salt-api (external_auth needs a master restart to take effect).
- verify.yml (run last): wait_for 4505 + salt_api_port, then a POST /login
  readiness probe asserting eauth works (skippable via -e salt_api_verify=false).
- README.md runbook: sudo/become prerequisite + exact re-apply command.
20 source-contract tests; all role YAML parses. Closes #659.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the test Test coverage improvement label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Coverage Report

84.4% on fleet_platform/services/ (gate: 80%)

Gate passed

@hellodk
hellodk merged commit 03795ba into master Jun 9, 2026
11 checks passed
@hellodk
hellodk deleted the feat/salt-master-role-reapply branch June 9, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Test coverage improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ansible: salt_master role must re-apply ACL + restart salt-api on an already-provisioned master (no manual sudo)

1 participant