mirror of
https://git.local.zernis.ch/simon/homeserver.zernis.ch.git
synced 2025-12-15 20:59:40 +01:00
added nextcloud role
This commit is contained in:
9
main.yml
9
main.yml
@@ -18,4 +18,11 @@
|
|||||||
become: true
|
become: true
|
||||||
roles:
|
roles:
|
||||||
- npm
|
- npm
|
||||||
tags: npm
|
tags: npm
|
||||||
|
|
||||||
|
- name: Configure Nextcloud
|
||||||
|
hosts: nextcloud_hosts
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- nextcloud
|
||||||
|
tags: nextcloud
|
||||||
66
roles/nextcloud/tasks/main.yml
Normal file
66
roles/nextcloud/tasks/main.yml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
- name: Create Nextcloud directories if they do not exist
|
||||||
|
become: false
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /home/{{ user['name'] }}/docker/nextcloud/{{ item }}
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
loop: '{{ nextcloud_folder }}'
|
||||||
|
|
||||||
|
- name: Create docker network 'nextcloud_internal'
|
||||||
|
community.docker.docker_network:
|
||||||
|
name: nextcloud_internal
|
||||||
|
|
||||||
|
- name: Create docker network 'proxy'
|
||||||
|
community.docker.docker_network:
|
||||||
|
name: proxy
|
||||||
|
|
||||||
|
- name: Create Nextcloud Maria-DB Container
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: nextcloud_db
|
||||||
|
image: 'mariadb:latest'
|
||||||
|
state: started
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
env:
|
||||||
|
MYSQL_ROOT_PASSWORD: "{{ NEXTCLOUD_MYSQL_ROOT_PASS | string }}"
|
||||||
|
MYSQL_DATABASE: "{{ NEXTCLOUD_MYSQL_DB | string }}"
|
||||||
|
MYSQL_USER: "{{ NEXTCLOUD_MYSQL_USER | string }}"
|
||||||
|
MYSQL_PASSWORD: "{{ NEXTCLOUD_MYSQL_PASS | string }}"
|
||||||
|
volumes:
|
||||||
|
- /home/{{ user['name'] }}/docker/nextcloud/db:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- name: nextcloud_internal
|
||||||
|
|
||||||
|
- name: Create Nextcloud Redis Container
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: nextcloud_redis
|
||||||
|
image: 'redis:alpine:latest'
|
||||||
|
state: started
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- /home/{{ user['name'] }}/docker/nextcloud/redis:/var/lib/redis
|
||||||
|
networks:
|
||||||
|
- name: nextcloud_internal
|
||||||
|
|
||||||
|
- name: Create Nextcloud Container
|
||||||
|
community.docker.docker_container:
|
||||||
|
name: nextcloud_app
|
||||||
|
image: 'nextcloud:latest'
|
||||||
|
pull: yes
|
||||||
|
state: started
|
||||||
|
restart_policy: unless-stopped
|
||||||
|
ports:
|
||||||
|
- '11000:80'
|
||||||
|
env:
|
||||||
|
DB_MYSQL_HOST: "{{ NEXTCLOUD_MYSQL_HOST | string }}"
|
||||||
|
DB_MYSQL_PORT: "{{ NEXTCLOUD_MYSQL_PORT | string }}"
|
||||||
|
DB_MYSQL_USER: "{{ NEXTCLOUD_MYSQL_USER | string }}"
|
||||||
|
DB_MYSQL_PASSWORD: "{{ NEXTCLOUD_MYSQL_PASS | string }}"
|
||||||
|
DB_MYSQL_NAME: "{{ NEXTCLOUD_MYSQL_DB | string }}"
|
||||||
|
REDIS_HOST: nextcloud_redis
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- /home/{{ user['name'] }}/docker/nextcloud/data:/data
|
||||||
|
networks:
|
||||||
|
- name: nextcloud_internal
|
||||||
|
- name: proxy
|
||||||
11
roles/nextcloud/vars/main.yml
Normal file
11
roles/nextcloud/vars/main.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
npm_folder:
|
||||||
|
- data
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
|
|
||||||
|
NPM_MYSQL_HOST: 'nextcloud_db'
|
||||||
|
NPM_MYSQL_PORT: '3306'
|
||||||
|
NPM_MYSQL_DB: nextcloud
|
||||||
|
NPM_MYSQL_USER: nextcloud
|
||||||
|
NPM_MYSQL_PASS: 'y%3U^n&&PPwEaS7HVmjPUfWqpvuC*UDn'
|
||||||
|
NPM_MYSQL_ROOT_PASS: 'fV$gUVdkwdrsL^&n4!^@@fX#W3Jpf4WM'
|
||||||
Reference in New Issue
Block a user