Files
config-public/ansible/playbooks/stackctl.yml
T
Lucas WintherandClaude Opus 5.5 35b1378080
lint / yamllint + ansible-lint + syntax (push) Successful in 56s
lint / shellcheck (push) Successful in 7s
lint / secret scan (push) Successful in 2s
Add stackctl for running stacks by hand on a host
One shared script installed into /srv/stacks on every host, with per-host
groups in server/<host>/stack-groups. Tested in check.sh. Also two new
common mistakes in the adding-a-stack skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:49:12 +02:00

36 lines
1.2 KiB
YAML

---
# stackctl, and each host's groups for it, into the stack root. Not a Compose
# stack: two files and no `docker compose up`, so plain tasks rather than the
# role, as with banner.yml.
#
# The script is one file shared by every host, under server/shared/components/.
# The groups are per host, at server/<host>/stack-groups, because each host runs
# different stacks; a host without one still gets the script, and "all" and
# stack names work there without any groups. See "On the host: stackctl" in the
# README.
- name: Install stackctl
hosts:
- edge
- app
gather_facts: false
tags: [stackctl]
vars:
stackctl_src: "{{ repo_root }}/server/shared/components/stackctl"
stackctl_groups_src: "{{ repo_root }}/server/{{ inventory_hostname }}/stack-groups"
tasks:
- name: Install the stackctl script
ansible.builtin.copy:
src: "{{ stackctl_src }}"
dest: "{{ stack_root }}/stackctl"
mode: "0755"
# `is file` is evaluated on the control node, where the repository is.
- name: Install this host's stack groups
ansible.builtin.copy:
src: "{{ stackctl_groups_src }}"
dest: "{{ stack_root }}/stack-groups"
mode: "0644"
when: stackctl_groups_src is file