summaryrefslogtreecommitdiff
path: root/roles/nextcloud/tasks/main.yml
blob: 8c9346d44b2afc6ca541c42152bf81e567e8b509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
- name: install php packages
  apt:
    name: '{{ nextcloud_php_present }}'
    install_recommends: 'no'

- name: Check Nextcloud installed
  ansible.builtin.stat:
    path: "{{ nextcloud_webroot }}/index.php"
  register: nc_nextcloud_installed

- name: Downloading Nextcloud
  ansible.builtin.include_tasks: download.yml
  when: not nc_nextcloud_installed.stat.exists

- name: Check Nextcloud configuration exists.
  ansible.builtin.stat:
    path: "{{ nextcloud_webroot }}/config/config.php"
  register: nc_nextcloud_conf

- name: Check Nextcloud is configured
  ansible.builtin.command: grep -q "{{ nextcloud_trusted_domain | first }}" {{ nextcloud_webroot }}/config/config.php
  failed_when: false
  changed_when: false
  register: nc_nextcloud_configured
  when: nc_nextcloud_conf.stat.exists

- name: Nextcloud installation
  ansible.builtin.include_tasks: installation.yml
  when: |
    (not nc_nextcloud_conf.stat.exists) or
    (nc_nextcloud_configured.rc is defined and nc_nextcloud_configured.rc != 0)