diff options
| author | Kumar Damani <me@kumardamani.net> | 2025-06-30 21:11:10 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2025-06-30 21:11:10 +0000 |
| commit | a125ec65a120ce23e4e692a48eaa169bc40e5506 (patch) | |
| tree | c1c7ed19c1e00f33d5fe6d7caa3c622945b3c423 /ansible/roles/nextcloud/tasks | |
| parent | 7e603bcc92c7ddc19dbfb0c46434bc6847ad3781 (diff) | |
ansible refactor to newer methods
Diffstat (limited to 'ansible/roles/nextcloud/tasks')
| -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 |
3 files changed, 17 insertions, 22 deletions
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' |
