-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathclean.yml
36 lines (31 loc) · 1.06 KB
/
clean.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
# This playbook removes objects that are no longer used. By used, we mean
# objects labelled with a deployment stamp that is no longer active, i.e.
# neither the previous, current or next static-services are pointing to a
# service labelled with this deployment stamp.
#
# Warning: this playbook has only effects on blue-green compatible apps.
- name: Clean the namespace
hosts: local
gather_facts: false
pre_tasks:
- name: Check configuration
ansible.builtin.import_tasks: tasks/check_configuration.yml
- name: Check apps filter
ansible.builtin.import_tasks: tasks/check_apps_filter.yml
tasks:
- name: Display playbook name
ansible.builtin.debug: msg="==== Starting clean playbook ===="
tags: clean
- name: Set vars
ansible.builtin.import_tasks: tasks/set_vars.yml
tags: clean
- name: Run tasks for apps
ansible.builtin.include_tasks: tasks/run_tasks_for_apps.yml
vars:
tasks:
- get_objects_for_app
- clean_app_orphans
tags:
- static_service
- clean