-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathtower-dr-failover.yml
55 lines (42 loc) · 1.42 KB
/
tower-dr-failover.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
- hosts: localhost
become: false
gather_facts: no
tasks:
- set_fact:
failover_type: dr
- import_playbook: tower-set-inventory-pm.yml
- import_playbook: tower-stop-services.yml
- import_playbook: tower-set-inventory-dr.yml
# when there is no replica, no action will be taken
- import_playbook: tower-pgsql-promote.yml
- name: setup inventory for dr site or primary site in failback and rerun tower installer
hosts: tower
vars_files: tower-vars.yml
vars:
_tower_eng_failover: "{{ tower_eng_failover | default(False) | bool }}"
tasks:
- name: normal Tower installer setup run for failover
block:
- include_role:
name: tower_install
vars:
tower_install_inventory: "{{ ansible_inventory_sources[0] }}"
tower_install_directory: "{{ tower_installer_current }}"
tower_install_ram_override: "{{ tower_ram_override }}"
delegate_to: localhost
run_once: true
when: not _tower_eng_failover
- name: shortcut/engineering cluster failover
block:
- name: point tower to new master database
include_role:
name: tower_db_active
- name: perform rabbitmq and cluster setup
include_role:
name: tower_cluster
when: _tower_eng_failover
become: true
- import_playbook: tower-deprovision.yml
- import_playbook: tower-setup-replication.yml
- import_playbook: tower-check-replication.yml