diff options
Diffstat (limited to 'ansible/roles/nextcloud')
| -rw-r--r-- | ansible/roles/nextcloud/defaults/main.yaml | 10 | ||||
| -rw-r--r-- | ansible/roles/nextcloud/meta/argument_specs.yaml | 25 | ||||
| -rw-r--r-- | ansible/roles/nextcloud/meta/main.yaml | 5 | ||||
| -rw-r--r-- | ansible/roles/nextcloud/tasks/config.yaml | 12 | ||||
| -rw-r--r-- | ansible/roles/nextcloud/tasks/main.yaml | 6 | ||||
| -rw-r--r-- | ansible/roles/nextcloud/tasks/setup.yaml | 21 |
6 files changed, 57 insertions, 22 deletions
diff --git a/ansible/roles/nextcloud/defaults/main.yaml b/ansible/roles/nextcloud/defaults/main.yaml new file mode 100644 index 0000000..138231f --- /dev/null +++ b/ansible/roles/nextcloud/defaults/main.yaml @@ -0,0 +1,10 @@ +--- + +nextcloud_nas_mount_path: '{{ vaultvar_nextcloud_nas_nfs_path }}' +nextcloud_php_max_mem_mb: 8000 +nextcloud_php_max_upload_size_gb: 10 +# You should have DRI devices showing up in your container in `/dev/dri/`. +# See the TF readme for steps to enable this. +# If not, then set this to false here. +# Leave this as a yaml string, it is going to used as a shell var. +nextcloud_enable_dri: 'true' diff --git a/ansible/roles/nextcloud/meta/argument_specs.yaml b/ansible/roles/nextcloud/meta/argument_specs.yaml new file mode 100644 index 0000000..60a7f85 --- /dev/null +++ b/ansible/roles/nextcloud/meta/argument_specs.yaml @@ -0,0 +1,25 @@ +--- + +argument_specs: + main: + short_description: Main entry point for the Nextcloud AIO role + description: + - This role installs the Nextcloud All-in-One flavour as a Docker Compose project. + author: + - Kumar Damani + options: + nextcloud_nas_mount_path: + type: 'str' + required: true + description: + - The path to the data on the NFS share. + nextcloud_php_max_mem_mb: + type: 'int' + required: true + description: + - The max mem in MB to give PHP. + nextcloud_php_max_upload_size_gb: + type: 'int' + required: true + description: + - The max size in GB to allow for file uploads. diff --git a/ansible/roles/nextcloud/meta/main.yaml b/ansible/roles/nextcloud/meta/main.yaml new file mode 100644 index 0000000..bd4979e --- /dev/null +++ b/ansible/roles/nextcloud/meta/main.yaml @@ -0,0 +1,5 @@ +--- + +dependencies: + - role: 'base' + - role: 'docker' diff --git a/ansible/roles/nextcloud/tasks/config.yaml b/ansible/roles/nextcloud/tasks/config.yaml new file mode 100644 index 0000000..367e7d5 --- /dev/null +++ b/ansible/roles/nextcloud/tasks/config.yaml @@ -0,0 +1,12 @@ +--- + +- name: 'config | Copy the docker-compose file' + ansible.builtin.template: + src: 'docker-compose.yaml.j2' + dest: 'docker-compose.yaml' + mode: '644' + +- name: 'config | Start the service' + ansible.builtin.command: 'docker-compose up -d' + register: '_compose_up_cmd' + changed_when: '_compose_up_cmd.rc == 0' diff --git a/ansible/roles/nextcloud/tasks/main.yaml b/ansible/roles/nextcloud/tasks/main.yaml index 0d3697b..62d9b46 100644 --- a/ansible/roles/nextcloud/tasks/main.yaml +++ b/ansible/roles/nextcloud/tasks/main.yaml @@ -2,4 +2,8 @@ - name: 'Run the setup tasks' ansible.builtin.import_tasks: 'setup.yaml' - tags: 'nextcloud' + tags: ['install'] + +- name: 'Run the config tasks' + ansible.builtin.import_tasks: 'config.yaml' + tags: ['install', 'config'] diff --git a/ansible/roles/nextcloud/tasks/setup.yaml b/ansible/roles/nextcloud/tasks/setup.yaml index ac17702..ae3bff9 100644 --- a/ansible/roles/nextcloud/tasks/setup.yaml +++ b/ansible/roles/nextcloud/tasks/setup.yaml @@ -1,15 +1,5 @@ --- -- name: 'setup | Ensure required vars are set' - ansible.builtin.assert: - that: - - item | mandatory - loop: - - '{{ nextcloud_nas_mount_path }}' - - '{{ nextcloud_php_max_mem_mb }}' - - '{{ nextcloud_php_max_upload_size_gb }}' - no_log: true - - name: 'setup | Install required pkgs' ansible.builtin.package: name: @@ -27,14 +17,3 @@ path: '/mnt/data' state: 'mounted' fstype: 'nfs' - -- name: 'setup | Copy the docker-compose file' - ansible.builtin.template: - src: 'docker-compose.yaml.j2' - dest: 'docker-compose.yaml' - mode: '644' - -- name: 'setup | Start the service' - ansible.builtin.command: 'docker-compose up -d' - register: '_compose_up_cmd' - changed_when: '_compose_up_cmd.rc == 0' |
