-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteardown-three-tier-app.yml.ori
91 lines (73 loc) · 1.75 KB
/
teardown-three-tier-app.yml.ori
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
- name: Teardown Postgres 10
hosts: database_servers
become: true
gather_facts: false
vars:
postgres_rhel7_repo: pgdg-redhat-repo-42.0-11.noarch
postgres_packages:
- postgresql10
- postgresql10-server
- postgresql10-contrib
- postgresql10-libs
postgres_library: "python-psycopg2"
postgres_10_data_dir: /var/lib/pgsql/10/data
postgres_port: 5432
tasks:
- name: Remove Postgres packages
package:
name: "{{ __package }}"
state: absent
loop:
- "{{ postgres_rhel7_repo }}"
- "{{ postgres_library }}"
- "{{ postgres_packages }}"
loop_control:
loop_var: __package
- name: Remove Postgres 10 data directory
file:
path: /var/lib/pgsql/10
state: absent
- name: Remove Postgres user
user:
name: postgres
state: absent
- name: Teardown Application Tier
hosts: app_servers
gather_facts: false
become: true
vars:
tomcat_packages:
- tomcat
tomcat_port: 8080
tomcat_service: tomcat
tags:
- app_servers
tasks:
- name: Remove Tomcat package(s)
package:
name: "{{ tomcat_packages }}"
state: absent
- name: Create Tomcat content directory
file:
path: /usr/share/tomcat
state: absent
- name: Teardown haproxy load balancer
hosts: load_balancers
gather_facts: false
become: true
vars:
load_balancer_packages:
- haproxy
tags:
- load_balancers
tasks:
- name: Remove load balancer packages
package:
name: "{{ load_balancer_packages }}"
state: absent
# - name: configure haproxy
# file:
# path: /etc/haproxy/haproxy.cfg
# state: absent
...