1
0
Fork 0

Compare commits

..

No commits in common. "44c7406d77f77da6fb5c8fa1d9fb6a65197d84bf" and "ff01e1ac64556eead2fe89fe92bfe2651e854490" have entirely different histories.

5 changed files with 24 additions and 59 deletions

View file

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

View file

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

View file

@ -13,15 +13,17 @@
ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml" ansible.builtin.include_tasks: "{{ role_path }}/tasks/install.yml"
- tags: - tags:
- post-install-all - adjust-nextcloud-config
- post-install-nextcloud
block: block:
- when: nextcloud_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/post_install.yml"
- when: nextcloud_enabled | bool - when: nextcloud_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/adjust_config.yml" 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: - tags:
- install-nextcloud-app-collabora - install-nextcloud-app-collabora
block: block:

View file

@ -1,34 +0,0 @@
---
- 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

@ -0,0 +1,11 @@
---
- 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 }}`)