-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathswitch.yml
35 lines (30 loc) · 1.1 KB
/
switch.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
---
# This playbook switches all static services:
# 1. point the "previous" static service to the stack that was pointed by the "current" static service,
# 2. point the "current" static service to the stack that was pointed by the "next" static service,
# 3. delete the stack that was pointed by the "previous" static service,
# 4. patch the next static service to the init stamp
- name: Switch stacks
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 switch playbook ===="
tags: deploy
- name: Set vars
ansible.builtin.import_tasks: tasks/set_vars.yml
- name: Run tasks for apps
ansible.builtin.include_tasks: tasks/run_tasks_for_apps.yml
vars:
tasks:
- get_objects_for_app
- switch_static_services
- switch_cronjobs
tags:
- static_service
- switch