forked from LemmyNet/lemmy-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.yml
38 lines (31 loc) · 999 Bytes
/
uninstall.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
---
- hosts: all
vars_prompt:
- name: confirm_uninstall
prompt: "Do you really want to uninstall Lemmy? This will delete all data and can not be reverted [yes/no]"
private: no
- name: delete_certs
prompt: "Delete certificates? Select 'no' if you want to reinstall Lemmy [yes/no]"
private: no
tasks:
- name: end play if no confirmation was given
debug:
msg: "Uninstall cancelled, doing nothing"
when: not confirm_uninstall|bool
- meta: end_play
when: not confirm_uninstall|bool
- name: stop docker-compose
docker_compose:
project_src: "{{lemmy_base_dir}}/{{domain}}"
state: absent
- name: delete data
file:
path: "{{item.path}}"
state: absent
with_items:
- path: "{{lemmy_base_dir}}/{{domain}}"
- path: "/etc/nginx/sites-enabled/{{domain}}.conf"
- name: remove certbot cronjob
cron:
name: certbot-renew-lemmy
state: absent