Fixed file permissions and multitenancy feature (manually tested).
This commit is contained in:
parent
4992e21ecf
commit
520ee33b0e
16 changed files with 68 additions and 54 deletions
71
tasks/main.yml
Normal file → Executable file
71
tasks/main.yml
Normal file → Executable file
|
|
@ -22,64 +22,41 @@
|
|||
- debug:
|
||||
var: output
|
||||
|
||||
- name: Provide compose project env vars
|
||||
template:
|
||||
src: templates/env.j2
|
||||
dest: "{{ nextcloud_install_path }}/nextcloud/.env"
|
||||
owner: "{{ nextcloud_install_user }}"
|
||||
group: "{{ nextcloud_install_user }}"
|
||||
mode: '0640'
|
||||
tags: config
|
||||
|
||||
- name: Provide database env vars
|
||||
copy:
|
||||
template:
|
||||
src: templates/db.env.j2
|
||||
dest: "{{ nextcloud_install_path }}/nextcloud/db.env"
|
||||
owner: "{{ nextcloud_install_user }}"
|
||||
group: "{{ nextcloud_install_user }}"
|
||||
mode: '0640'
|
||||
content: |
|
||||
# See https://github.com/docker-library/mariadb/issues/262
|
||||
MYSQL_INITDB_SKIP_TZINFO=1
|
||||
MYSQL_ROOT_PASSWORD={{ nextcloud_mariadb_root_password }}
|
||||
MYSQL_DATABASE={{ nextcloud_mysql_database }}
|
||||
MYSQL_PASSWORD={{ nextcloud_mariadb_password }}
|
||||
MYSQL_USER={{ nextcloud_mariadb_user }}
|
||||
tags: config
|
||||
|
||||
- name: Provide Nextcloud env vars
|
||||
copy:
|
||||
template:
|
||||
src: templates/nextcloud.env.j2
|
||||
dest: "{{ nextcloud_install_path }}/nextcloud/nextcloud.env"
|
||||
owner: "{{ nextcloud_install_user }}"
|
||||
group: "{{ nextcloud_install_user }}"
|
||||
mode: '0640'
|
||||
content: |
|
||||
VIRTUAL_HOST={{ nextcloud_virtual_host }}
|
||||
LETSENCRYPT_HOST={{ nextcloud_letsencrypt_host }}
|
||||
LETSENCRYPT_EMAIL={{ nextcloud_letsencrypt_email }}
|
||||
MYSQL_HOST={{ nextcloud_mysql_host }}
|
||||
MYSQL_DATABASE={{ nextcloud_mysql_database }}
|
||||
MYSQL_PASSWORD={{ nextcloud_mariadb_password }}
|
||||
MYSQL_USER={{ nextcloud_mariadb_user }}
|
||||
NEXTCLOUD_ADMIN_USER={{ nextcloud_admin_user }}
|
||||
NEXTCLOUD_ADMIN_PASSWORD={{ nextcloud_admin_password }}
|
||||
NEXTCLOUD_TRUSTED_DOMAINS={{ nextcloud_trusted_domains }}
|
||||
SMTP_HOST={{ nextcloud_smtp_host }}
|
||||
SMTP_SECURE={{ nextcloud_smtp_secure }}
|
||||
SMTP_PORT={{ nextcloud_smtp_port }}
|
||||
SMTP_AUTHTYPE={{ nextcloud_smtp_authtype }}
|
||||
SMTP_NAME={{ nextcloud_smtp_name }}
|
||||
SMTP_PASSWORD={{ nextcloud_smtp_password }}
|
||||
MAIL_FROM_ADDRESS={{ nextcloud_mail_from_address }}
|
||||
MAIL_DOMAIN={{ nextcloud_mail_domain }}
|
||||
tags: config
|
||||
|
||||
- name: Provide restic-compose-backup env vars
|
||||
copy:
|
||||
template:
|
||||
src: templates/restic-compose-backup.env.j2
|
||||
dest: "{{ nextcloud_install_path }}/nextcloud/restic-compose-backup.env"
|
||||
owner: "{{ nextcloud_install_user }}"
|
||||
group: "{{ nextcloud_install_user }}"
|
||||
mode: '0640'
|
||||
content: |
|
||||
AWS_ACCESS_KEY_ID={{ nextcloud_restic_aws_access_key_id }}
|
||||
AWS_SECRET_ACCESS_KEY={{ nextcloud_restic_aws_secret_access_key }}
|
||||
RESTIC_REPOSITORY={{ nextcloud_restic_repository }}
|
||||
RESTIC_PASSWORD={{ nextcloud_restic_password }}
|
||||
# snapshot prune rules
|
||||
RESTIC_KEEP_DAILY={{ nextcloud_restic_keep_daily}}
|
||||
RESTIC_KEEP_WEEKLY={{ nextcloud_restic_keep_weekly }}
|
||||
RESTIC_KEEP_MONTHLY={{ nextcloud_restic_keep_monthly }}
|
||||
RESTIC_KEEP_YEARLY={{ nextcloud_restic_keep_yearly }}
|
||||
# Cron schedule. Run every day at 1am
|
||||
CRON_SCHEDULE="{{ nextcloud_restic_cron_schedule }}"
|
||||
tags: config
|
||||
when: nextcloud_enable_restic_compose_backup == true
|
||||
|
||||
- name: "docker-compose: Teardown existing Nextcloud service"
|
||||
|
|
@ -99,11 +76,11 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- "output.ansible_facts['nextcloud-app']['nextcloud-app'].state.running"
|
||||
- "output.ansible_facts['nextcloud-app']['nextcloud{{ nextcloud_multitenant_postfix }}_nextcloud-app_1'].state.running"
|
||||
|
||||
- name: Get container IP
|
||||
- name: "Get container IP"
|
||||
set_fact:
|
||||
nextcloud_ip: "{{ output.ansible_facts['nextcloud-app']['nextcloud-app'].networks.nextcloud_default.IPAddress }}"
|
||||
nextcloud_ip: "{{ output.ansible_facts['nextcloud-app']['nextcloud' + nextcloud_multitenant_postfix + '_nextcloud-app_1'].networks['nextcloud' + nextcloud_multitenant_postfix + '_default'].IPAddress }}"
|
||||
|
||||
- name: "Waiting for Nextcloud container to become available"
|
||||
become: false
|
||||
|
|
@ -114,16 +91,16 @@
|
|||
- name: "docker-compose: Set overwriteprotocol using occ"
|
||||
shell:
|
||||
chdir: "{{ nextcloud_install_path }}/nextcloud/"
|
||||
cmd: docker-compose exec -T -u www-data nextcloud-app /bin/bash -c './occ config:system:set overwriteprotocol --value="{{ nextcloud_overwrite_protocol }}"'
|
||||
cmd: docker-compose exec -T -u www-data nextcloud{{ nextcloud_multitenant_postfix }}_nextcloud-app_1 /bin/bash -c './occ config:system:set overwriteprotocol --value="{{ nextcloud_overwrite_protocol }}"'
|
||||
|
||||
- name: "docker-compose: Set overwrite.cli.url using occ"
|
||||
shell:
|
||||
chdir: "{{ nextcloud_install_path }}/nextcloud/"
|
||||
cmd: docker-compose exec -T -u www-data nextcloud-app /bin/bash -c './occ config:system:set overwrite.cli.url --value="{{ nextcloud_overwrite_cli_url }}"'
|
||||
cmd: docker-compose exec -T -u www-data nextcloud{{ nextcloud_multitenant_postfix }}_nextcloud-app_1 /bin/bash -c './occ config:system:set overwrite.cli.url --value="{{ nextcloud_overwrite_cli_url }}"'
|
||||
|
||||
- name: "docker-compose: Set overwritehost using occ"
|
||||
shell:
|
||||
cmd: docker-compose exec -T -u www-data nextcloud-app /bin/bash -c './occ config:system:set overwritehost --value="{{ nextcloud_overwrite_host }}"'
|
||||
cmd: docker-compose exec -T -u www-data nextcloud{{ nextcloud_multitenant_postfix }}_nextcloud-app_1 /bin/bash -c './occ config:system:set overwritehost --value="{{ nextcloud_overwrite_host }}"'
|
||||
chdir: "{{ nextcloud_install_path }}/nextcloud/"
|
||||
|
||||
- name: "Test whether Nextcloud is healthy from the outside"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue