forked from tonykay/bad-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcleanup.yml
37 lines (32 loc) · 784 Bytes
/
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
---
- name: cleanup
hosts: all
gather_facts: false
become: true
vars:
three_tier_packages:
- httpie
- python-pip
- haproxy
- tomcat
- postgresql-server
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 index.html
file:
path: /tmp/index.html
state: absent
...