added Seafile. todo: traefik
This commit is contained in:
parent
70c3ae31de
commit
d61fc21f32
7 changed files with 95 additions and 0 deletions
3
Makefile
3
Makefile
|
@ -34,4 +34,7 @@ borg:
|
|||
dataserver:
|
||||
ansible-playbook playbooks/dataserver.yml -i inventory/hosts.yml --ask-vault-pass
|
||||
|
||||
seafile:
|
||||
ansible-playbook playbooks/seafile.yml -i inventory/hosts.yml --ask-vault-pass
|
||||
|
||||
.PHONY: run
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
- forgejo
|
||||
- radicale
|
||||
- mastodon
|
||||
- seafile
|
||||
- name: Setup dataserver
|
||||
hosts: dataserver
|
||||
roles:
|
||||
|
|
4
playbooks/seafile.yml
Normal file
4
playbooks/seafile.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: Install Seafile
|
||||
hosts: homeserver
|
||||
roles:
|
||||
- seafile
|
4
roles/seafile/meta/main.yml
Normal file
4
roles/seafile/meta/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
dependencies:
|
||||
- role: common
|
||||
- role: docker
|
||||
- role: traefik
|
17
roles/seafile/tasks/main.yml
Normal file
17
roles/seafile/tasks/main.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
- name: Create Seafile app directory
|
||||
file:
|
||||
path: "{{ service_dir }}"
|
||||
state: directory
|
||||
- name: Copy Docker Compose script
|
||||
template:
|
||||
src: "{{ role_path }}/templates/docker-compose.yml.j2"
|
||||
dest: "{{ service_dir }}/docker-compose.yml"
|
||||
- name: Create data directory
|
||||
file:
|
||||
path: "{{ data_dir }}"
|
||||
state: directory
|
||||
- name: Start Docker Compose
|
||||
docker_compose:
|
||||
project_src: "{{ service_dir }}"
|
||||
pull: true
|
||||
remove_orphans: true
|
44
roles/seafile/templates/docker-compose.yml.j2
Normal file
44
roles/seafile/templates/docker-compose.yml.j2
Normal file
|
@ -0,0 +1,44 @@
|
|||
version: '2.0'
|
||||
services:
|
||||
db:
|
||||
image: mariadb:10.5
|
||||
container_name: seafile-mysql
|
||||
restart: always
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD={{ db_root_passwd }} # Requested, set the root's password of MySQL service.
|
||||
- MYSQL_LOG_CONSOLE=true
|
||||
volumes:
|
||||
- {{ data_dir }}/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
|
||||
networks:
|
||||
- default
|
||||
|
||||
memcached:
|
||||
image: memcached:1.6
|
||||
container_name: seafile-memcached
|
||||
restart: always
|
||||
entrypoint: memcached -m 256
|
||||
networks:
|
||||
- default
|
||||
|
||||
seafile:
|
||||
image: seafileltd/seafile-mc:9.0.10
|
||||
container_name: seafile
|
||||
restart: always
|
||||
ports:
|
||||
- "81:80"
|
||||
# - "443:443" # If https is enabled, cancel the comment.
|
||||
volumes:
|
||||
- {{ data_dir }}/data:/shared # Requested, specifies the path to Seafile data persistent store.
|
||||
environment:
|
||||
- DB_HOST=db
|
||||
- DB_ROOT_PASSWD={{ db_root_passwd }} # Requested, the value shuold be root's password of MySQL service.
|
||||
- TIME_ZONE=Europe/Amsterdam
|
||||
- SEAFILE_ADMIN_EMAIL={{ seafile_admin_email }} # Specifies Seafile admin user, default is 'me@example.com'.
|
||||
- SEAFILE_ADMIN_PASSWORD={{ seafile_admin_password }} # Specifies Seafile admin password.
|
||||
- SEAFILE_SERVER_LETSENCRYPT=false # Whether to use https or not.
|
||||
- SEAFILE_SERVER_HOSTNAME={{ seafile_domain }} # Specifies your host name if https is enabled.
|
||||
depends_on:
|
||||
- db
|
||||
- memcached
|
||||
networks:
|
||||
- default
|
22
roles/seafile/vars/main.yml
Normal file
22
roles/seafile/vars/main.yml
Normal file
|
@ -0,0 +1,22 @@
|
|||
service_name: seafile
|
||||
data_dir: "{{ base_data_dir }}/{{ service_name }}"
|
||||
service_dir: "{{ base_service_dir }}/{{ service_name }}"
|
||||
|
||||
db_root_passwd: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
62376163363033396161363264613836623734623835316439666331356464636633393237313236
|
||||
3731383961393939366165393537663435356166643966650a353132616166353630333733636639
|
||||
63616163346566336461313264326562393964643661613831316233326165623463613865636637
|
||||
6363363331333430320a366661356232393036383765353066623334656133313661636130666238
|
||||
32336561323431303730373262343534326539383932613533623232376330646230363363636135
|
||||
3266336663623037663838643936366437663831356634333930
|
||||
seafile_admin_email: niels@kunis.nl
|
||||
seafile_admin_password: !vault |
|
||||
$ANSIBLE_VAULT;1.1;AES256
|
||||
34366163396632343065636232363435633039373236363461383563363162626561653763383438
|
||||
3263393539663030363532353238633262616339343436370a613631323064303637623266653832
|
||||
64323834356664316265376132633863666136316239623862643962366637306238343933386134
|
||||
6237396238383232360a386637303639646136653134643737393735383661626539386134643333
|
||||
35313536323963303734353338636162666236343430623062373464653531353230366238326231
|
||||
6661363038393534373861643261383561386536613337396539
|
||||
seafile_domain: files.geokunis2.nl
|
Reference in a new issue