]> Untitled Git - lemmy.git/blob - ansible/uninstall.yml
Merge remote-tracking branch 'upstream/master'
[lemmy.git] / ansible / uninstall.yml
1 ---
2 - hosts: all
3
4   vars_prompt:
5
6     - name: confirm_uninstall
7       prompt: "Do you really want to uninstall Lemmy? This will delete all data and can not be reverted [yes/no]"
8       private: no
9
10     - name: delete_certs
11       prompt: "Delete certificates? Select 'no' if you want to reinstall Lemmy [yes/no]"
12       private: no
13
14   tasks:
15   - name: end play if no confirmation was given
16     debug:
17       msg: "Uninstall cancelled, doing nothing"
18     when: not confirm_uninstall|bool
19
20   - meta: end_play
21     when: not confirm_uninstall|bool
22
23   - name: stop docker-compose
24     docker_compose:
25       project_src: /lemmy/
26       state: absent
27
28   - name: delete data
29     file: path={{item.path}} state=absent
30     with_items:
31       - { path: '/lemmy/' }
32       - { path: '/etc/nginx/sites-enabled/lemmy.conf' }
33
34   - name: Remove a volume
35     docker_volume: name={{item.name}} state=absent
36     with_items:
37       - { name: 'lemmy_lemmy_db' }
38       - { name: 'lemmy_lemmy_pictshare' }
39
40   - name: delete entire ecloud folder
41     file: path='/mnt/repo-base/' state=absent
42     when: delete_certs|bool
43
44   - name: remove certbot cronjob
45     cron:
46       name=certbot-renew-lemmy
47       state=absent
48