diff --git a/defaults/main.yml b/defaults/main.yml index 1e8a322..35c20c9 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -27,3 +27,5 @@ nextcloud_server_names: - "{{ inventory_hostname }}" nextcloud_force_downgrade: false + +timezone: UTC diff --git a/tasks/configure.yml b/tasks/configure.yml index 221d00d..62cddc0 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -28,6 +28,12 @@ chdir: "{{nextcloud_directory}}" when: nextcloud_version is version('14.0.0','ge') + - name: nextcloud occ config:system:set logtimezone + command: php occ config:system:set logtimezone --value="{{timezone}}" + args: + chdir: "{{nextcloud_directory}}" + when: _nextcloud_config.system.logtimezone != timezone + - name: nextcloud occ maintenance:update:htaccess command: php occ maintenance:update:htaccess args: diff --git a/templates/config.php.j2 b/templates/config.php.j2 index 666e933..5bf4417 100644 --- a/templates/config.php.j2 +++ b/templates/config.php.j2 @@ -9,7 +9,7 @@ $CONFIG = array( 'log_type' => 'file', 'logfile' => '{{nextcloud_log_directory}}/nextcloud.log', 'loglevel' => 2, -'logtimezone' => 'UTC', +'logtimezone' => '{{timezone}}', 'appstoreenabled' => true, 'apps_paths' => array( array(