-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpatroni.yml
57 lines (51 loc) · 1.26 KB
/
patroni.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
56
57
---
- name: setup facts
hosts: all
vars_files:
- vars.yml
pre_tasks:
- name: Gather facts from ALL hosts (regardless of limit or tags)
setup:
delegate_to: "{{ item }}"
delegate_facts: True
when: hostvars[item]['ansible_default_ipv4'] is not defined
with_items: "{{ groups['all'] }}"
tasks:
- include: tasks/set_dcs_ips.yml
- include: tasks/set_pgsql_servers_ips.yml
- name: setup DCS servers
hosts: dcs_servers
vars_files:
- vars.yml
become: true
become_user: root
become_method: sudo
tasks:
- include: tasks/{{ dcs }}.yml
- name: setup HAProxy server
hosts: haproxy_server
vars_files:
- vars.yml
tasks:
- include: tasks/haproxy.yml
- name: setup Postgres Servers
hosts: pgsql_servers
become: true
become_user: root
become_method: sudo
vars_files:
- vars.yml
pre_tasks:
- name: Gather facts from ALL hosts (regardless of limit or tags)
setup:
delegate_to: "{{ item }}"
delegate_facts: True
when: hostvars[item]['ansible_default_ipv4'] is not defined
with_items: "{{ groups['all'] }}"
tags:
- config
tasks:
- include: tasks/consul.yml
when: dcs == "consul"
- include: tasks/postgresql.yml
- include: tasks/patroni.yml