diff options
| author | Kumar Damani <me@kumardamani.net> | 2023-08-11 16:28:54 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2023-08-11 16:28:54 +0000 |
| commit | 1f321db8949b3aeb80afdd7a94e92b7743c3e275 (patch) | |
| tree | f48b7040615af1bda263faa4d2657636c77ba2a4 /ansible/roles/nextcloud/tasks | |
| parent | 9bae899e227e4899a5ee629bf305a00a39044bc2 (diff) | |
Work
Diffstat (limited to 'ansible/roles/nextcloud/tasks')
| -rw-r--r-- | ansible/roles/nextcloud/tasks/main.yaml | 5 | ||||
| -rw-r--r-- | ansible/roles/nextcloud/tasks/setup.yaml | 40 |
2 files changed, 45 insertions, 0 deletions
diff --git a/ansible/roles/nextcloud/tasks/main.yaml b/ansible/roles/nextcloud/tasks/main.yaml new file mode 100644 index 0000000..0d3697b --- /dev/null +++ b/ansible/roles/nextcloud/tasks/main.yaml @@ -0,0 +1,5 @@ +--- + +- name: 'Run the setup tasks' + ansible.builtin.import_tasks: 'setup.yaml' + tags: 'nextcloud' diff --git a/ansible/roles/nextcloud/tasks/setup.yaml b/ansible/roles/nextcloud/tasks/setup.yaml new file mode 100644 index 0000000..ac17702 --- /dev/null +++ b/ansible/roles/nextcloud/tasks/setup.yaml @@ -0,0 +1,40 @@ +--- + +- 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: + - 'nfs-common' + +- name: 'setup | Create the mount dir' + ansible.builtin.file: + path: '/mnt/data' + state: 'directory' + mode: '755' + +- name: 'setup | Setup the NFS mount' + ansible.posix.mount: + src: '{{ nextcloud_nas_mount_path }}' + 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' |
