From 68726c1065a1733f361382537ff5048eca16f5a6 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Thu, 30 Jul 2026 18:04:24 +0200 Subject: [PATCH] Initial nextcloud playbook --- ansible/playbooks/nextcloud.yaml | 15 +++++++++ .../roles/nextcloud_aio/defaults/main.yaml | 4 +++ .../roles/nextcloud_aio/tasks/main.yaml | 2 ++ .../tasks/nextcloud_docker_aio.yaml | 33 +++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 ansible/playbooks/nextcloud.yaml create mode 100644 ansible/playbooks/roles/nextcloud_aio/defaults/main.yaml create mode 100644 ansible/playbooks/roles/nextcloud_aio/tasks/main.yaml create mode 100644 ansible/playbooks/roles/nextcloud_aio/tasks/nextcloud_docker_aio.yaml diff --git a/ansible/playbooks/nextcloud.yaml b/ansible/playbooks/nextcloud.yaml new file mode 100644 index 0000000..492641e --- /dev/null +++ b/ansible/playbooks/nextcloud.yaml @@ -0,0 +1,15 @@ +--- +- name: Install Nextcloud + hosts: nextcloud + tasks: + - include_role: + name: geerlingguy.docker + apply: + become: true + become_exe: "{{ become_exe_value }}" + + - include_role: + name: "{{ item }}" + loop: + - newt_client + - nextcloud_aio \ No newline at end of file diff --git a/ansible/playbooks/roles/nextcloud_aio/defaults/main.yaml b/ansible/playbooks/roles/nextcloud_aio/defaults/main.yaml new file mode 100644 index 0000000..cea8237 --- /dev/null +++ b/ansible/playbooks/roles/nextcloud_aio/defaults/main.yaml @@ -0,0 +1,4 @@ +nextcloud_docker_image_name: "ghcr.io/nextcloud-releases/all-in-one" +nextcloud_docker_image_tag: latest +nextcloud_docker_skip_domain_validation: "true" +nextcloud_docker_mastercontainer_volume_dir: /usr/data/nextcloud_aio_mastercontainer \ No newline at end of file diff --git a/ansible/playbooks/roles/nextcloud_aio/tasks/main.yaml b/ansible/playbooks/roles/nextcloud_aio/tasks/main.yaml new file mode 100644 index 0000000..a18beca --- /dev/null +++ b/ansible/playbooks/roles/nextcloud_aio/tasks/main.yaml @@ -0,0 +1,2 @@ +--- +- import_tasks: nextcloud_docker_aio.yaml \ No newline at end of file diff --git a/ansible/playbooks/roles/nextcloud_aio/tasks/nextcloud_docker_aio.yaml b/ansible/playbooks/roles/nextcloud_aio/tasks/nextcloud_docker_aio.yaml new file mode 100644 index 0000000..021ef65 --- /dev/null +++ b/ansible/playbooks/roles/nextcloud_aio/tasks/nextcloud_docker_aio.yaml @@ -0,0 +1,33 @@ +--- +- name: Pull docker image + docker_image: + name: "{{ nextcloud_docker_image_name }}" + tag: "{{ nextcloud_docker_image_tag }}" + source: pull + +- name: Create Master Container volume dir + file: + path: "{{ nextcloud_docker_mastercontainer_volume_dir }}" + state: directory + mode: "0766" + +- name: Create container + docker_container: + name: nextcloud-aio-mastercontainer + image: "{{ nextcloud_docker_image_name }}:{{ nextcloud_docker_image_tag }}" + ports: + - "8080:8080" + # - "80:80" + # - "8443:8443" + env: + APACHE_PORT: "11000" + APACHE_IP_BINDING: "0.0.0.0" + # APACHE_ADDITIONAL_NETWORK: "" + SKIP_DOMAIN_VALIDATION: "{{ nextcloud_docker_skip_domain_validation }}" + volumes: + - nextcloud_aio_mastercontainer:/mnt/docker-aio-config + - /var/run/docker.sock:/var/run/docker.sock:ro + networks: + - name: newt_compose_default + restart_policy : "always" + init : true \ No newline at end of file