@@ -4,9 +4,9 @@ nextcloud_archive_directory: /opt/nextcloud | |||||
nextcloud_directory: /var/www/nextcloud | nextcloud_directory: /var/www/nextcloud | ||||
nextcloud_data_directory: "{{nextcloud_directory}}/data" | |||||
nextcloud_data_directory: /var/lib/nextcloud/data | |||||
nextcloud_version: 14.0.2 | |||||
nextcloud_version: 14.0.3 | |||||
nextcloud_apps: | nextcloud_apps: | ||||
- contacts | - contacts | ||||
@@ -20,6 +20,7 @@ | |||||
- apps | - apps | ||||
- themes | - themes | ||||
- updater | - updater | ||||
- data | |||||
- name: nextcloud data directory | - name: nextcloud data directory | ||||
file: | file: | ||||
@@ -1,32 +1,37 @@ | |||||
--- | --- | ||||
- name: get nextcloud apps list | |||||
uri: | |||||
url: https://apps.nextcloud.com/api/v1/platform/{{ nextcloud_version }}/apps.json | |||||
register: _nextcloud_apps_list | |||||
- debug: | |||||
msg: | |||||
_nextcloud_apps: "{{ _nextcloud_apps }}" | |||||
- name: occ app list | |||||
command: php occ app:list | |||||
args: | |||||
chdir: /var/www/nextcloud | |||||
register: _nextcloud_occ_app_list | |||||
changed_when: false | |||||
become: true | |||||
become_user: www-data | |||||
become_method: sudo | |||||
- name: nextcloud apps download | |||||
get_url: | |||||
url: "{{ _nextcloud_apps[item].url }}" | |||||
dest: "{{nextcloud_archive_directory}}/nextcloud-{{item}}-{{ _nextcloud_apps[item].version }}.tar.gz" | |||||
with_items: "{{ nextcloud_apps }}" | |||||
- name: nextcloud install apps | |||||
command: php occ app:install {{item}} | |||||
with_items: "{{ nextcloud_apps | difference(_nextcloud_apps_present) }}" | |||||
args: | |||||
chdir: /var/www/nextcloud | |||||
become: true | |||||
become_user: www-data | |||||
become_method: sudo | |||||
- name: nextcloud apps extract | |||||
unarchive: | |||||
src: "{{nextcloud_archive_directory}}/nextcloud-{{item}}-{{ _nextcloud_apps[item].version }}.tar.gz" | |||||
dest: /var/www/nextcloud/apps/ | |||||
remote_src: yes | |||||
owner: root | |||||
group: root | |||||
with_items: "{{ nextcloud_apps }}" | |||||
- name: occ app list | |||||
command: php occ app:list | |||||
args: | |||||
chdir: /var/www/nextcloud | |||||
register: _nextcloud_occ_app_list | |||||
changed_when: false | |||||
become: true | |||||
become_user: www-data | |||||
become_method: sudo | |||||
- name: nextcloud enable apps | - name: nextcloud enable apps | ||||
command: php occ app:enable {{item.name}} | |||||
with_items: "{{ nextcloud_apps }}" | |||||
command: php occ app:enable {{item}} | |||||
with_items: "{{ nextcloud_apps | difference(_nextcloud_apps_enabled) }}" | |||||
args: | args: | ||||
chdir: /var/www/nextcloud | chdir: /var/www/nextcloud | ||||
become: true | become: true | ||||
@@ -0,0 +1,30 @@ | |||||
--- | |||||
- name: nextcloud core integrity check | |||||
command: php occ integrity:check-core | |||||
args: | |||||
chdir: /var/www/nextcloud | |||||
changed_when: false | |||||
become: true | |||||
become_user: www-data | |||||
become_method: sudo | |||||
- name: occ app list | |||||
command: php occ app:list | |||||
args: | |||||
chdir: /var/www/nextcloud | |||||
register: _nextcloud_occ_app_list | |||||
changed_when: false | |||||
become: true | |||||
become_user: www-data | |||||
become_method: sudo | |||||
- name: nextcloud apps integrity checks | |||||
command: php occ integrity:check-app {{item}} | |||||
with_items: "{{ _nextcloud_apps_present }}" | |||||
args: | |||||
chdir: /var/www/nextcloud | |||||
changed_when: false | |||||
become: true | |||||
become_user: www-data | |||||
become_method: sudo |
@@ -5,34 +5,34 @@ | |||||
url: https://apps.nextcloud.com/api/v1/platforms.json | url: https://apps.nextcloud.com/api/v1/platforms.json | ||||
register: _nextcloud_platforms | register: _nextcloud_platforms | ||||
- name: nextcloud archive checksum download | |||||
- name: nextcloud core archive checksum download | |||||
get_url: | get_url: | ||||
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256 | url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256 | ||||
dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256" | dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256" | ||||
- name: nextcloud server archive checksum | |||||
- name: nextcloud core archive checksum | |||||
shell: cat "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256" | shell: cat "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.sha256" | ||||
register: _nextcloud_server_archive_checksum | register: _nextcloud_server_archive_checksum | ||||
changed_when: false | changed_when: false | ||||
- name: nextcloud archive download | |||||
- name: nextcloud core archive download | |||||
get_url: | get_url: | ||||
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2 | url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2 | ||||
dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2" | dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2" | ||||
checksum: sha256:{{ _nextcloud_server_archive_checksum.stdout_lines[0].split(' ')[0] }} | checksum: sha256:{{ _nextcloud_server_archive_checksum.stdout_lines[0].split(' ')[0] }} | ||||
- name: nextcloud archive signature download | |||||
- name: nextcloud core archive signature download | |||||
get_url: | get_url: | ||||
url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2.asc | url: https://download.nextcloud.com/server/releases/nextcloud-{{ nextcloud_version }}.tar.bz2.asc | ||||
dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.asc" | dest: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.asc" | ||||
- name: nextcloud archive signature check | |||||
- name: nextcloud core archive signature check | |||||
command: gpg --no-default-keyring --keyring "{{nextcloud_archive_directory}}/keyring.gpg" | command: gpg --no-default-keyring --keyring "{{nextcloud_archive_directory}}/keyring.gpg" | ||||
--verify "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.asc" | --verify "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2.asc" | ||||
"{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2" | "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2" | ||||
changed_when: false | changed_when: false | ||||
- name: nextcloud extract | |||||
- name: nextcloud core extract | |||||
unarchive: | unarchive: | ||||
src: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2" | src: "{{nextcloud_archive_directory}}/nextcloud-{{ nextcloud_version }}.tar.bz2" | ||||
remote_src: yes | remote_src: yes |
@@ -9,7 +9,7 @@ | |||||
- import_tasks: reset.yml | - import_tasks: reset.yml | ||||
when: nextcloud_state == "reinstalled" | when: nextcloud_state == "reinstalled" | ||||
- import_tasks: server.yml | |||||
- import_tasks: core.yml | |||||
- import_tasks: access.yml | - import_tasks: access.yml | ||||
- import_tasks: mysql.yml | - import_tasks: mysql.yml | ||||
@@ -22,7 +22,9 @@ | |||||
- import_tasks: configure.yml | - import_tasks: configure.yml | ||||
#- import_tasks: apps.yml | |||||
- import_tasks: apps.yml | |||||
- import_tasks: check.yaml | |||||
- import_tasks: upgrade.yml | - import_tasks: upgrade.yml | ||||
@@ -22,6 +22,7 @@ | |||||
- php-apcu | - php-apcu | ||||
- memcached | - memcached | ||||
- php-memcached | - php-memcached | ||||
- libreoffice | |||||
notify: restart apache2 | notify: restart apache2 | ||||
- name: remove default page | - name: remove default page | ||||
@@ -1,3 +1,6 @@ | |||||
_nextcloud_config: "{{ _nextcloud_config_cmd.stdout | from_json }}" | _nextcloud_config: "{{ _nextcloud_config_cmd.stdout | from_json }}" | ||||
_nextcloud_latest: "{{ lookup('template','nextcloud-latest.json.j2') |from_json }}" | _nextcloud_latest: "{{ lookup('template','nextcloud-latest.json.j2') |from_json }}" | ||||
_nextcloud_apps: "{{ lookup('template','nextcloud-apps.json.j2') }}" | _nextcloud_apps: "{{ lookup('template','nextcloud-apps.json.j2') }}" | ||||
_nextcloud_apps_enabled: "{{ _nextcloud_occ_app_list.stdout | from_yaml | json_query('Enabled|[]|map(&keys(@), @)|[]') }}" | |||||
_nextcloud_apps_disabled: "{{ _nextcloud_occ_app_list.stdout | from_yaml | json_query('Disabled|[]') }}" | |||||
_nextcloud_apps_present: "{{ _nextcloud_apps_enabled | union(_nextcloud_apps_disabled) }}" |