-
Notifications
You must be signed in to change notification settings - Fork 0
/
purge.yml
85 lines (69 loc) · 1.66 KB
/
purge.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
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
---
# Purges stars4all tessdb
- hosts: temporary
become: yes
tasks:
- name: stops tessdb service on dest machine
service: name=tessdb state=stopped
ignore_errors: true
- name: Delete systemd tessdb service unit
file:
path: /lib/systemd/system/tessdb.service
state: absent
register: systemd_changed
- name: systemd daemon reload
command: systemctl daemon-reload
when: systemd_changed
- name: delete system level Pip packages if any
pip:
name : '{{ item }}'
state : absent
with_items:
- twisted
- twisted-mqtt
- pyephem
- jinja2
- tabulate
- pytz
ignore_errors: true
- name: Delete all the virtualenv
file:
path: '{{ tessdb_venv_dir }}'
state: absent
- name: Delete /etc/tessdb directory
file:
path: /etc/tessdb
state: absent
- name: Delete latest log files entry
file:
path: /var/log/tessdb.log
state: absent
- name: find previous log entries
find:
paths: /var/log
patterns: tessdb.log-*
register: files_to_delete
- name: remove previous log entries
file:
path: '{{ item.path }}'
state: absent
with_items: '{{ files_to_delete.files }}'
- name: Delete logrotate entry
file:
path: /etc/logrotate_astro.d/tessdb
state: absent
- name: Delete commands
file:
path: '/usr/local/bin/{{ item }}'
state: absent
with_items:
- tessdb
- tessdb3
- tessdb_pause
- tessdb_resume
- tessdb_index.sh
- tess
- name: Delete database dir and contents
file:
path: '{{ tessdb_dbase_dir }}'
state: absent