Compare commits
10 commits
ff01e1ac64
...
44c7406d77
Author | SHA1 | Date | |
---|---|---|---|
44c7406d77 | |||
55466b7efb | |||
|
20ec60eba0 | ||
|
05a1713402 | ||
|
604d1a6e5f | ||
|
110526f68e | ||
|
2a9ce7d0a1 | ||
|
2a74dd14d8 | ||
|
5422798239 | ||
|
0f109cac25 |
5 changed files with 59 additions and 24 deletions
|
@ -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',
|
||||
},
|
||||
])
|
||||
+
|
||||
([
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
34
tasks/post_install.yml
Normal 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 != '')"
|
|
@ -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 }}`)
|
Loading…
Reference in a new issue