mirror of https://github.com/LemmyNet/lemmy
Fix Ansible installation, add uninstall playbook
parent
8cfd5f9266
commit
91234db53b
@ -0,0 +1,35 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
lemmy:
|
||||
image: dessalines/lemmy:v0.6.5
|
||||
ports:
|
||||
- "127.0.0.1:8536:8536"
|
||||
restart: always
|
||||
volumes:
|
||||
- ./lemmy.hjson:/config/config.hjson:ro
|
||||
depends_on:
|
||||
- lemmy_db
|
||||
- lemmy_pictshare
|
||||
|
||||
lemmy_db:
|
||||
image: postgres:12-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=lemmy
|
||||
- POSTGRES_PASSWORD={{ postgres_password }}
|
||||
- POSTGRES_DB=lemmy
|
||||
volumes:
|
||||
- lemmy_db:/var/lib/postgresql/data
|
||||
restart: always
|
||||
|
||||
lemmy_pictshare:
|
||||
image: shtripok/pictshare:latest
|
||||
ports:
|
||||
- "127.0.0.1:8537:80"
|
||||
volumes:
|
||||
- lemmy_pictshare:/usr/share/nginx/html/data
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
lemmy_db:
|
||||
lemmy_pictshare:
|
@ -0,0 +1,48 @@
|
||||
---
|
||||
- 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/
|
||||
state: absent
|
||||
|
||||
- name: delete data
|
||||
file: path={{item.path}} state=absent
|
||||
with_items:
|
||||
- { 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
|
||||
|
||||
- name: remove certbot cronjob
|
||||
cron:
|
||||
name=certbot-renew-lemmy
|
||||
state=absent
|
||||
|
Loading…
Reference in New Issue