diff --git a/cloudbox.yml b/cloudbox.yml index 9fcfeb7..16d8bfe 100644 --- a/cloudbox.yml +++ b/cloudbox.yml @@ -12,6 +12,10 @@ DNS: "192.168.2.1" ddns_domain: "something.ddnss.de" ddns_updkey: "138638.some.key.here.635620" + ## 'nc_download' and 'nc_checksum' are only + ## used for ansible-pull during installation: + nc_download: "https://download.nextcloud.com/server/releases/latest.tar.bz2" + nc_checksum: "sha256:194095a5586d84040bc455f77b8aa6c80f9a6a6dd713c9aebdad046713d4267b" nc_apps: - calendar - notes diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index a8f0747..b247284 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -16,7 +16,9 @@ The nextcloud archive nextcloud.tar.bz2 is not available. Download the latest stable release from 'nextcloud.com', check the signature, rename it and copy it next to 'cloudbox.yml'. - when: not nextcloud.stat.exists and not nc_archive.stat.exists + when: > + not nextcloud.stat.exists and not nc_archive.stat.exists and + not run_in_installer|default(false)|bool ## We can start with the installation now: @@ -136,6 +138,10 @@ group: www-data ## install nextcloud: +- name: start mariadb during installation + command: /etc/init.d/mysql start + when: run_in_installer|default(false)|bool + - name: create database with name 'nextcloud' mysql_db: login_unix_socket: /var/run/mysqld/mysqld.sock @@ -152,13 +158,29 @@ state: present when: not nextcloud.stat.exists -- name: unpack nextcloud archive +- name: download nextcloud archive + get_url: + url: "{{ nc_download }}" + dest: /tmp/nextcloud.tar.bz2 + checksum: "{{ nc_checksum }}" + when: run_in_installer|default(false)|bool + +- name: unpack downloaded nextcloud archive + unarchive: + src: /tmp/nextcloud.tar.bz2 + dest: "{{ www_root }}" + owner: www-data + group: www-data + remote_src: Yes + when: not nextcloud.stat.exists and run_in_installer|default(false)|bool + +- name: unpack provided nextcloud archive unarchive: src: nextcloud.tar.bz2 dest: "{{ www_root }}" owner: www-data group: www-data - when: not nextcloud.stat.exists + when: not nextcloud.stat.exists and not run_in_installer|default(false)|bool - name: initialize nextcloud command: @@ -232,6 +254,12 @@ permanent: Yes immediate: Yes state: enabled + when: not run_in_installer|default(false)|bool + +- name: allow https in firewalld, offline + command: "firewall-offline-cmd --add-service=https" + when: run_in_installer|default(false)|bool + ## ToDo kerberox integration: