34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
---
|
|
# webapp-decommission.yml — Decommission webapp blueprint instances
|
|
#
|
|
# Aether sends ffsdn_instances (a list of all instances in the deployment).
|
|
# This playbook loops over each instance and routes to component-specific cleanup.
|
|
|
|
- name: Webapp decommission — graceful cleanup via Incus API
|
|
hosts: localhost
|
|
gather_facts: false
|
|
connection: local
|
|
|
|
vars:
|
|
incus_api: "https://192.168.102.140:8443"
|
|
incus_cert: "/runner/project/incus-client.crt"
|
|
incus_key: "/runner/project/incus-client.key"
|
|
blueprint_name: "webapp"
|
|
decommission_tasks:
|
|
db: "showcase/decommission/webapp-db.yml"
|
|
web: "showcase/decommission/webapp-web.yml"
|
|
|
|
tasks:
|
|
- name: Validate required variables
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ffsdn_instances is defined
|
|
- ffsdn_instances | length > 0
|
|
fail_msg: "ffsdn_instances must be provided by Aether"
|
|
|
|
- name: Decommission each instance
|
|
ansible.builtin.include_tasks: showcase/decommission/webapp-instance.yml
|
|
loop: "{{ ffsdn_instances }}"
|
|
loop_control:
|
|
loop_var: instance
|