r/nextcloud: Dynamically set version in config
Nextcloud thinks it needs to run the upgrade/migration tool if the version number in its configuration file does not match the running version. It then updates the config file with the correct version. The next time the configuration policy is applied, however, the version will revert back to whatever is set in the template. This will re-trigger the upgrade notification. To avoid this problem, we now set the version in the configuration file dynamically. Nextcloud writes its version number in a constant in `version.php`.ntfy
parent
7ab3787798
commit
7d7dda6061
|
@ -12,6 +12,21 @@
|
||||||
tags:
|
tags:
|
||||||
- install
|
- install
|
||||||
|
|
||||||
|
- name: check nextcloud version
|
||||||
|
command: >-
|
||||||
|
php -r 'require "/usr/share/nextcloud/version.php";
|
||||||
|
echo join(".", $OC_Version);'
|
||||||
|
check_mode: false
|
||||||
|
changed_when: false
|
||||||
|
register: check_nc_version
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
- name: set nc_version fact
|
||||||
|
set_fact:
|
||||||
|
nc_version: '{{ check_nc_version.stdout }}'
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
- name: ensure nextcloud database user exists
|
- name: ensure nextcloud database user exists
|
||||||
become: true
|
become: true
|
||||||
become_user: postgres
|
become_user: postgres
|
||||||
|
|
|
@ -35,7 +35,7 @@ $CONFIG = array (
|
||||||
),
|
),
|
||||||
'datadirectory' => '/var/lib/nextcloud/data',
|
'datadirectory' => '/var/lib/nextcloud/data',
|
||||||
'dbtype' => 'pgsql',
|
'dbtype' => 'pgsql',
|
||||||
'version' => '20.0.8.1',
|
'version' => '{{ nc_version }}',
|
||||||
'overwrite.cli.url' => 'https://{{ nextcloud_server_name }}',
|
'overwrite.cli.url' => 'https://{{ nextcloud_server_name }}',
|
||||||
'dbname' => 'nextcloud',
|
'dbname' => 'nextcloud',
|
||||||
'dbhost' => 'localhost',
|
'dbhost' => 'localhost',
|
||||||
|
|
Loading…
Reference in New Issue