2020-01-28 16:38:23 +00:00
|
|
|
---
|
|
|
|
- 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:
|
2020-03-28 22:18:20 +00:00
|
|
|
project_src: /lemmy/
|
2020-01-28 16:38:23 +00:00
|
|
|
state: absent
|
|
|
|
|
|
|
|
- name: delete data
|
|
|
|
file: path={{item.path}} state=absent
|
|
|
|
with_items:
|
2020-03-28 22:18:20 +00:00
|
|
|
- { path: '/lemmy/' }
|
|
|
|
- { path: '/etc/nginx/sites-enabled/lemmy.conf' }
|
|
|
|
|
|
|
|
- name: Remove a volume
|
|
|
|
docker_volume: name={{item.name}} state=absent
|
|
|
|
with_items:
|
|
|
|
- { name: 'lemmy_lemmy_db' }
|
|
|
|
- { name: 'lemmy_lemmy_pictshare' }
|
|
|
|
|
|
|
|
- name: delete entire ecloud folder
|
|
|
|
file: path='/mnt/repo-base/' state=absent
|
|
|
|
when: delete_certs|bool
|
2020-01-28 16:38:23 +00:00
|
|
|
|
|
|
|
- name: remove certbot cronjob
|
|
|
|
cron:
|
|
|
|
name=certbot-renew-lemmy
|
|
|
|
state=absent
|
|
|
|
|