Initial commit
commit
546fbf4f2e
@ -0,0 +1,32 @@
|
|||||||
|
```yml
|
||||||
|
- name: "Install nextcloud"
|
||||||
|
hosts: czynna1
|
||||||
|
vars:
|
||||||
|
domain: "cloud.strona-czynna.pl"
|
||||||
|
nextcloud_admin_port: 8342
|
||||||
|
nextcloud_ui_port: 8343
|
||||||
|
nextcloud_file_storage_path: /mnt/juice/nextcloud
|
||||||
|
nextcloud_workdir: /var/www/nextcloud
|
||||||
|
nextcloud_domain: "{{ domain }}"
|
||||||
|
roles:
|
||||||
|
- role: nextcloud
|
||||||
|
tags:
|
||||||
|
- nextcloud
|
||||||
|
- role: sealcode.nginx.proxies
|
||||||
|
tags:
|
||||||
|
- nextcloud
|
||||||
|
vars:
|
||||||
|
- nginx_proxies:
|
||||||
|
- domain: "cloud-admin.strona-czynna.pl"
|
||||||
|
site_name: "nextcloud-admin"
|
||||||
|
upstream: "https://127.0.0.1:{{nextcloud_admin_port}}"
|
||||||
|
auth_enabled: true
|
||||||
|
auth_message: "Please log in"
|
||||||
|
auth_user: "admin"
|
||||||
|
auth_password: password
|
||||||
|
- domain: "{{ domain }}"
|
||||||
|
site_name: "nextcloud"
|
||||||
|
upstream: "http://127.0.0.1:{{nextcloud_ui_port}}"
|
||||||
|
max_upload_size: "32G"
|
||||||
|
disable_ratelimit: true
|
||||||
|
```
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
nextcloud_admin_port: 8342
|
||||||
|
nextcloud_ui_port: 8343
|
||||||
|
nextcloud_file_storage_path: /mnt/juice/nextcloud
|
||||||
|
nextcloud_workdir: /var/www/nextcloud
|
||||||
|
nextcloud_domain: "cloud.example.com"
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: kuba
|
||||||
|
description: nextcloud-docker
|
||||||
|
license: MIT
|
||||||
|
min_ansible_version: "2.12"
|
||||||
|
platforms:
|
||||||
|
- name: Debian
|
||||||
|
versions:
|
||||||
|
- bullseye
|
||||||
|
- bookworm
|
||||||
|
- name: Ubuntu
|
||||||
|
versions:
|
||||||
|
- focal
|
||||||
|
- jammy
|
||||||
|
|
||||||
|
dependencies: []
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
- name: "docker compose down"
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
state: "absent"
|
||||||
|
project_src: "{{nextcloud_workdir}}"
|
||||||
|
register: compose_result
|
||||||
|
failed_when: >
|
||||||
|
compose_result.failed and
|
||||||
|
("is not a directory" not in compose_result.msg) and
|
||||||
|
("does not contain compose.yaml" not in compose_result.msg)
|
||||||
|
|
||||||
|
- name: "Create the nextcloud directory"
|
||||||
|
file:
|
||||||
|
path: "{{ nextcloud_workdir }}"
|
||||||
|
state: "directory"
|
||||||
|
|
||||||
|
- name: Create docker-compose.yml file for Nextcloud
|
||||||
|
template:
|
||||||
|
src: docker-compose.yml.j2
|
||||||
|
dest: "{{ nextcloud_workdir }}/docker-compose.yml"
|
||||||
|
|
||||||
|
- name: "docker compose up -d nextcloud"
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
state: "present"
|
||||||
|
pull: missing
|
||||||
|
project_src: "{{ nextcloud_workdir }}"
|
||||||
|
|
||||||
|
- ansible.builtin.lineinfile:
|
||||||
|
path: "/backup-dirs"
|
||||||
|
line: "{{ nextcloud_file_storage_path }}"
|
||||||
|
|
||||||
|
- ufw:
|
||||||
|
rule: "allow"
|
||||||
|
port: "{{item}}"
|
||||||
|
loop:
|
||||||
|
- 3478 # nextcloud talk
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
# from https://github.com/nextcloud/all-in-one/blob/3fc84ee78438fc7c07e8d/compose.yaml, cleaned up
|
||||||
|
|
||||||
|
name: nextcloud-aio
|
||||||
|
services:
|
||||||
|
nextcloud-aio-mastercontainer:
|
||||||
|
image: nextcloud/all-in-one:latest
|
||||||
|
container_name: nextcloud-aio-mastercontainer
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:{{ nextcloud_admin_port }}:8080"
|
||||||
|
|
||||||
|
environment:
|
||||||
|
APACHE_PORT: {{ nextcloud_ui_port }}
|
||||||
|
APACHE_IP_BINDING: 127.0.0.1
|
||||||
|
|
||||||
|
NEXTCLOUD_DATADIR: "/mnt/ncdata"
|
||||||
|
|
||||||
|
SKIP_DOMAIN_VALIDATION: "true"
|
||||||
|
TALK_PORT: 3478
|
||||||
|
|
||||||
|
NEXTCLOUD_ENABLE_DRI_DEVICE: "false"
|
||||||
|
|
||||||
|
NEXTCLOUD_MEMORY_LIMIT: 2048M
|
||||||
|
NEXTCLOUD_UPLOAD_LIMIT: 16G
|
||||||
|
NEXTCLOUD_MAX_TIME: 99999
|
||||||
|
|
||||||
|
OVERWRITEPROTOCOL: https
|
||||||
|
OVERWRITEHOST: {{ nextcloud_domain }}
|
||||||
|
|
||||||
|
# Optional:
|
||||||
|
# WATCHTOWER_DOCKER_SOCKET_PATH: /var/run/docker.sock
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
- nextcloud_aio_mastercontainer:/mnt/docker-aio-config
|
||||||
|
- "{{ nextcloud_file_storage_path }}/data:/mnt/ncdata"
|
||||||
|
- "{{ nextcloud_file_storage_path }}/backups:/mnt/backup"
|
||||||
|
|
||||||
|
networks:
|
||||||
|
- nextcloud-aio
|
||||||
|
|
||||||
|
volumes: # If you want to store the data on a different drive, see https://github.com/nextcloud/all-in-one#how-to-store-the-filesinstallation-on-a-separate-drive
|
||||||
|
nextcloud_aio_mastercontainer:
|
||||||
|
name: nextcloud_aio_mastercontainer
|
||||||
|
|
||||||
|
networks:
|
||||||
|
nextcloud-aio:
|
||||||
|
name: nextcloud-aio
|
||||||
Loading…
Reference in New Issue