One role that syncs a payload and brings the stack up, configured entirely through stack_* variables, plus six playbooks that each demonstrate one part of that contract. Every playbook runs standalone and is tagged with its stack name, so site.yml --tags <stack> works. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
21 lines
643 B
YAML
21 lines
643 B
YAML
---
|
|
# Two entry points, so a playbook that must do maintenance between the payload
|
|
# landing and the stack starting can interleave its own tasks:
|
|
#
|
|
# - ansible.builtin.include_role:
|
|
# name: compose_stack
|
|
# tasks_from: sync
|
|
# - name: Run the database migration
|
|
# ...
|
|
# - ansible.builtin.include_role:
|
|
# name: compose_stack
|
|
# tasks_from: up
|
|
#
|
|
# Using the role normally (roles: - role: compose_stack) runs both, in order.
|
|
# playbooks/webapp.yml is the worked example.
|
|
- name: Sync the payload to the host
|
|
ansible.builtin.include_tasks: sync.yml
|
|
|
|
- name: Start the stack
|
|
ansible.builtin.include_tasks: up.yml
|