1
0
Fork 0

Compare commits

...

10 commits

Author SHA1 Message Date
44c7406d77 fix docs, now adjust-nextcloud-config tag is gone 2024-10-10 10:49:47 +01:00
55466b7efb implement non-interactive post-install 2024-10-08 13:57:49 +01:00
Slavi Pantaleev
20ec60eba0
Merge pull request #24 from sudo-Tiz/patch-1
Update adjust_config.yml - remove type for preview generator
2024-10-02 14:41:44 +03:00
Tiz
05a1713402
Update adjust_config.yml - remove type for preview generator
adjust-nextcloud-config tags is returning an error `Unknown type integer`  when setting the type to int or integer for jpeg_quality. 
This workaround proposes to remove the "type=" as the playbook works well without
2024-10-02 11:29:40 +00:00
Slavi Pantaleev
604d1a6e5f Upgrade (29.0.7 -> 30.0.0) 2024-09-21 17:23:24 +03:00
Slavi Pantaleev
110526f68e
Merge pull request #23 from neokyx/main
Update Nextcloud (v.29.0.6 > v.29.0.7)
2024-09-14 17:48:48 +03:00
Spyderfoo
2a9ce7d0a1
Update Nextcloud (v.29.0.6 > v.29.0.7) 2024-09-14 14:19:15 +02:00
Slavi Pantaleev
2a74dd14d8
Merge pull request #22 from neokyx/main
Update Nextcloud (v.29.0.4 > v29.0.6)
2024-09-12 12:15:00 +03:00
Spyderfoo
5422798239
Upgrade v.29.0.4 > v29.0.6 2024-09-12 07:39:55 +02:00
Slavi Pantaleev
0f109cac25 Configure maintenance_window_start to suppress Nextcloud warning 2024-08-08 08:56:47 +03:00
5 changed files with 59 additions and 24 deletions

View file

@ -13,7 +13,10 @@ nextcloud_hostname: ''
nextcloud_path_prefix: /
nextcloud_version: 29.0.4
nextcloud_initial_admin_username: admin
nextcloud_initial_admin_password: ''
nextcloud_version: 30.0.0
nextcloud_uid: ''
nextcloud_gid: ''
@ -51,7 +54,7 @@ nextcloud_customized_container_src_path: "{{ nextcloud_base_path }}/customized-c
# These values are based on the [upstream readme](https://github.com/nextcloud/previewgenerator) and also on experience.
# Feel free to change anything.
#
# Once installed, the playbook needs to be called with the adjust-nextcloud-config tag.
# Once installed, the playbook needs to be called with the `post-install-nextcloud` tag.
# This tag sets up the variables and calls the generate-all script, that will also create the file---signalling
# its finished state---on the host.
# *** As this may take a long time, be sure to only call it when you have time to leave it running!!! ***
@ -312,6 +315,10 @@ nextcloud_database_name: nextcloud
nextcloud_database_username: ''
nextcloud_database_password: ''
# Controls the maintenance_window_start configuration parameter.
# See: https://docs.nextcloud.com/server/29/admin_manual/configuration_server/background_jobs_configuration.html
nextcloud_config_parameter_maintenance_window_start: 1
# A list of configuration parameters for Nextcloud.
# To define your own, we advise editing `nextcloud_config_additional_parameters`.
nextcloud_config_parameters: "{{ nextcloud_config_default_parameters + nextcloud_config_additional_parameters }}"
@ -322,6 +329,11 @@ nextcloud_config_parameters: "{{ nextcloud_config_default_parameters + nextcloud
nextcloud_config_default_parameters: |
{{
([
{
'key': 'trusted_domains 1',
'value': nextcloud_hostname,
'type': 'string',
},
{
'key': 'overwriteprotocol',
'value': 'https',
@ -347,6 +359,11 @@ nextcloud_config_default_parameters: |
'value': false,
'type': 'boolean',
},
{
'key': 'maintenance_window_start',
'value': nextcloud_config_parameter_maintenance_window_start,
'type': 'integer',
},
])
+
([

View file

@ -30,22 +30,19 @@
- name: Adjust Nextcloud configuration values related to preview generator
ansible.builtin.command:
cmd: |-
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ {{ item.appType }} --type={{ item.type }} --value={{ item.value }} -- {{ item.appConfig }} {{ item.configName }}
docker exec --user={{ nextcloud_uid }}:{{ nextcloud_gid }} {{ nextcloud_identifier }}-server php /var/www/html/occ {{ item.appType }} --value={{ item.value }} -- {{ item.appConfig }} {{ item.configName }}
with_items:
- appType: "config:system:set"
appConfig: ""
configName: "preview_max_x"
type: "string"
value: "{{ nextcloud_preview_preview_max_x }}"
- appType: "config:system:set"
appConfig: ""
configName: "preview_max_y"
type: "string"
value: "{{ nextcloud_preview_preview_max_y }}"
- appType: "config:app:set"
appConfig: "preview"
configName: "jpeg_quality"
type: int
value: "{{ nextcloud_preview_app_jpeg_quality }}"
- name: "Check if {{ nextcloud_preview_first_run_finished_filename }} exists"

View file

@ -13,17 +13,15 @@
ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml"
- tags:
- adjust-nextcloud-config
- post-install-all
- post-install-nextcloud
block:
- when: nextcloud_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/post_install.yml"
- when: nextcloud_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/adjust_config.yml"
- tags:
- print-nextcloud-db-credentials
block:
- when: nextcloud_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/print_db_credentials.yml"
- tags:
- install-nextcloud-app-collabora
block:

34
tasks/post_install.yml Normal file
View file

@ -0,0 +1,34 @@
---
- name: Run occ maintenance:install
ansible.builtin.command:
cmd: >-
{{ devture_systemd_docker_base_host_command_docker }}
run
--rm
--name={{ nextcloud_identifier }}-post-install
--network={{ nextcloud_container_network }}
{% if postgres_enabled and nextcloud_database_hostname == postgres_identifier and nextcloud_container_network != postgres_container_network %}
--network={{ postgres_container_network }}
{% endif %}
--user={{ nextcloud_uid }}:{{ nextcloud_gid }}
--cap-drop=ALL
--read-only
--mount=type=bind,src={{ nextcloud_data_path }},dst=/var/www/html
--env-file={{ nextcloud_config_path }}/env
{{ nextcloud_container_image_final }}
php
/var/www/html/occ
maintenance:install
--database=pgsql
--database-host={{ nextcloud_database_hostname }}:{{ nextcloud_database_port }}
--database-name={{ nextcloud_database_name }}
--database-user={{ nextcloud_database_username }}
--database-pass={{ nextcloud_database_password }}
--admin-user={{ nextcloud_initial_admin_username }}
--admin-pass={{ nextcloud_initial_admin_password }}
register: result
# On successful change: 'Nextcloud was successfully installed' in result.stdout
# To be conservative, report 'changed' for any result other than the known 'already done' error message.
changed_when: "'Command \"maintenance:install\" is not defined.' not in result.stderr"
failed_when: "'Command \"maintenance:install\" is not defined.' not in result.stderr and (result.rc != 0 or result.stderr != '')"

View file

@ -1,11 +0,0 @@
---
- name: Print Nextcloud DB credentials
ansible.builtin.debug:
msg: >-
Your Nextcloud database information is:
Host (`{{ nextcloud_database_hostname }}`),
Port (`{{ nextcloud_database_port }}`),
Database Name (`{{ nextcloud_database_name }}`),
Database Username (`{{ nextcloud_database_username }}`),
Database Password (`{{ nextcloud_database_password }}`)