sync roles with changes from OWS
This commit is contained in:
@@ -46,11 +46,21 @@
|
||||
nextcloud_exporter_version: "{{ nextcloud_exporter_version | replace('v', '', 1) | trim }}"
|
||||
run_once: true
|
||||
|
||||
- name: Set architecture alias
|
||||
set_fact:
|
||||
architecture_alias: "amd64" # noqa: var-naming[no-role-prefix]
|
||||
when: ansible_architecture == "x86_64"
|
||||
|
||||
- name: Set architecture alias
|
||||
set_fact:
|
||||
architecture_alias: "arm64" # noqa: var-naming[no-role-prefix]
|
||||
when: ansible_architecture == "aarch64"
|
||||
|
||||
- name: "Download nextcloud_exporter from GitHub (v{{ nextcloud_exporter_version.tag }})"
|
||||
get_url:
|
||||
url: "https://github.com/xperimental/nextcloud-exporter/releases/download/\
|
||||
v{{ nextcloud_exporter_version.tag }}/nextcloud-exporter-{{ nextcloud_exporter_version.tag }}\
|
||||
-{{ deb_architecture }}.bz2"
|
||||
v{{ nextcloud_exporter_version.tag }}/nextcloud-exporter_{{ nextcloud_exporter_version.tag }}\
|
||||
_{{ architecture_alias }}.bz2"
|
||||
dest: "/var/tmp/nextcloud-exporter.bz2"
|
||||
mode: "0644"
|
||||
register: nextcloud_exporter_download_archive
|
||||
@@ -60,7 +70,7 @@
|
||||
|
||||
- name: Decompress nextcloud_exporter
|
||||
command:
|
||||
cmd: "bzip2 -dk nextcloud-exporter.bz2"
|
||||
cmd: "bzip2 -dkf nextcloud-exporter.bz2"
|
||||
args:
|
||||
chdir: /var/tmp/
|
||||
register: nextcloud_exporter_decompress_archive
|
||||
@@ -91,21 +101,11 @@
|
||||
nextcloud_notify_push_version: "{{ nextcloud_notify_push_version | replace('v', '', 1) | trim }}"
|
||||
run_once: true
|
||||
|
||||
- name: Set deb_architecture alias and filename
|
||||
set_fact:
|
||||
notify_push_filename: "x86_64-unknown-linux-musl" # noqa: var-naming[no-role-prefix]
|
||||
when: deb_architecture == "amd64"
|
||||
|
||||
- name: Set deb_architecture alias and filename
|
||||
set_fact:
|
||||
notify_push_filename: "armv7-unknown-linux-musleabihf" # noqa: var-naming[no-role-prefix]
|
||||
when: deb_architecture == "arm64"
|
||||
|
||||
- name: "Download nextcloud_notify_push from GitHub (v{{ nextcloud_notify_push_version.tag }})"
|
||||
get_url:
|
||||
url: "https://github.com/nextcloud/notify_push/releases/download/v{{ nextcloud_notify_push_version.tag }}\
|
||||
/notify_push-{{ notify_push_filename }}"
|
||||
dest: "/var/tmp/notify_push"
|
||||
/notify_push-{{ ansible_architecture }}-unknown-linux-musl"
|
||||
dest: "/var/tmp/nextcloud_notify_push"
|
||||
mode: "0700"
|
||||
register: nextcloud_notify_push_download_file
|
||||
until: nextcloud_notify_push_download_file is succeeded
|
||||
@@ -115,7 +115,7 @@
|
||||
- name: Copy nextcloud_notify_push
|
||||
copy:
|
||||
remote_src: true
|
||||
src: "/var/tmp/notify_push"
|
||||
src: "/var/tmp/nextcloud_notify_push"
|
||||
dest: "{{ nextcloud_notify_push_install_dir }}/nextcloud_notify_push"
|
||||
owner: "{{ webserver_user }}"
|
||||
group: "{{ webserver_group }}"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
- name: Install required python packages
|
||||
pip:
|
||||
name: gtar # needed for latest nextcloud tar.bz archive
|
||||
name: gtar # needed for latest nextcloud tar.bz2 archiv
|
||||
state: latest
|
||||
|
||||
- name: Enable APCu
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
# flush handlers to Restart code-server before install extensions
|
||||
# flush handlers to restart code-server before install extensions
|
||||
- name: Flush handlers befor continue
|
||||
meta: flush_handlers
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
register: nextcloud_dir_stat
|
||||
|
||||
- name: Install Nextcloud
|
||||
when: not nextcloud_dir_stat.stat.exists
|
||||
block:
|
||||
- name: Create nextcloud directory
|
||||
file:
|
||||
@@ -23,6 +24,7 @@
|
||||
get_url:
|
||||
url: "https://download.nextcloud.com/server/releases/latest.tar.bz2"
|
||||
dest: "/var/tmp/nextcloud.tar.gz"
|
||||
mode: "0644"
|
||||
register: nextcloud_download_archive
|
||||
until: nextcloud_download_archive is succeeded
|
||||
retries: 3
|
||||
@@ -79,17 +81,20 @@
|
||||
become_user: "{{ webserver_user }}"
|
||||
command:
|
||||
cmd: php occ config:import /tmp/nextcloud.config.json
|
||||
args:
|
||||
chdir: "{{ nextcloud_dir }}"
|
||||
|
||||
when: not nextcloud_dir_stat.stat.exists
|
||||
register: nextcloud_occ_config_import_output
|
||||
changed_when: nextcloud_occ_config_import_output.rc != 0
|
||||
|
||||
- name: Update Nextcloud
|
||||
when: nextcloud_updater
|
||||
block:
|
||||
- name: Run nextcloud's updater.phar in non-interactive way
|
||||
become: true
|
||||
become_user: "{{ webserver_user }}"
|
||||
command:
|
||||
cmd: 'php updater/updater.phar --no-interaction'
|
||||
args:
|
||||
chdir: "{{ nextcloud_dir }}"
|
||||
register: nextcloud_update_result
|
||||
changed_when: "'Start update' in nextcloud_update_result.stdout"
|
||||
@@ -97,17 +102,19 @@
|
||||
- name: Update result
|
||||
debug:
|
||||
msg: "{{ nextcloud_update_result.stdout_lines }}"
|
||||
when: nextcloud_update_result.changed
|
||||
when: nextcloud_update_result.changed # noqa: no-handler
|
||||
|
||||
- name: DB tuning after update
|
||||
become: true
|
||||
become_user: "{{ webserver_user }}"
|
||||
command:
|
||||
cmd: php occ {{ item }}
|
||||
args:
|
||||
chdir: "{{ nextcloud_dir }}"
|
||||
loop:
|
||||
- db:add-missing-indices
|
||||
- db:convert-filecache-bigint
|
||||
- integrity:check-core
|
||||
when: nextcloud_update_result.changed
|
||||
when: nextcloud_updater
|
||||
register: nextcloud_occ_update_tuning_output
|
||||
changed_when: nextcloud_occ_update_tuning_output.rc != 0
|
||||
when: nextcloud_update_result.changed # noqa: no-handler
|
||||
|
||||
Reference in New Issue
Block a user