forked from tonykay/bad-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup.yml
46 lines (40 loc) · 1.01 KB
/
cleanup.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
---
- name: cleanup
hosts: all
gather_facts: false
become: true
vars:
three_tier_packages:
- httpie
- python-pip
- haproxy
- tomcat
- postgresql-server
- httpd
tasks:
- name: reverse the enabling of sudo without tty for some ansible commands
replace:
path: /etc/sudoers
regexp: 'Defaults\s*!requiretty'
replace: '^Defaults requiretty'
backup: yes
- name: Remove the repo file
file:
state: absent
path: /etc/yum.repos.d/open_three-tier-app.repo
- name: Remove base tools and three tier app packages
yum:
name: "{{ three_tier_packages }}"
state: absent
- name: Remove tomcat directory
file:
path: /usr/share/tomcat/webapps/ROOT/
state: absent
- name: Remove index.html
file:
path: /usr/share/tomcat/webapps/ansible/index.html
state: absent
- name: Remove postgresql dir
file:
path: /var/lib/pgsql/
state: absent