working: ansible
This commit is contained in:
parent
68e8d0de54
commit
9b8651b17a
@ -6,4 +6,3 @@ community.docker.docker_compose_v2:
|
|||||||
services: ["nextcloud"]
|
services: ["nextcloud"]
|
||||||
state: "restarted"
|
state: "restarted"
|
||||||
when: not _nextcloud_already_restarted
|
when: not _nextcloud_already_restarted
|
||||||
|
|
||||||
|
|||||||
@ -16,5 +16,5 @@ galaxy_info:
|
|||||||
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||||
# Maximum 20 tags per role.
|
# Maximum 20 tags per role.
|
||||||
|
|
||||||
# dependencies:
|
dependencies:
|
||||||
# - role: base
|
- role: traefik
|
||||||
|
|||||||
@ -3,9 +3,16 @@
|
|||||||
set_fact:
|
set_fact:
|
||||||
nextcloud: "{{ (nextcloud_defaults | combine(nextcloud_override, recursive=True)) if nextcloud_override else nextcloud_defaults }}"
|
nextcloud: "{{ (nextcloud_defaults | combine(nextcloud_override, recursive=True)) if nextcloud_override else nextcloud_defaults }}"
|
||||||
|
|
||||||
|
- name: "set mail variables from overrides and defaults"
|
||||||
|
set_fact:
|
||||||
|
mail: "{{ (nextcloud_defaults | combine(nextcloud_override, recursive=True)) if nextcloud_override else nextcloud_defaults }}"
|
||||||
|
|
||||||
|
- set_fact:
|
||||||
|
nextcloud_container: "{{ role_name }}-nextcloud-1"
|
||||||
|
|
||||||
- name: ensure that path exists
|
- name: ensure that path exists
|
||||||
file:
|
file:
|
||||||
path: "{{ path }}/config/nextcloud"
|
path: "{{ path }}/config/"
|
||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
- name: template compose
|
- name: template compose
|
||||||
@ -16,13 +23,13 @@
|
|||||||
- name: template nc config
|
- name: template nc config
|
||||||
template:
|
template:
|
||||||
src: importconfig.json.j2
|
src: importconfig.json.j2
|
||||||
dest: "{{ path }}/config/nextcloud/importconfig.json"
|
dest: "{{ path }}/config/nextcloud-importconfig.json"
|
||||||
register: _importconfig
|
register: _importconfig
|
||||||
|
|
||||||
- import_role:
|
- import_role:
|
||||||
name: storage_mount
|
name: storage_mount
|
||||||
vars:
|
vars:
|
||||||
storagebox_override:
|
storage_mount_override:
|
||||||
host: "{{ nextcloud.networkmount.host }}"
|
host: "{{ nextcloud.networkmount.host }}"
|
||||||
host_path: "{{ nextcloud.networkmount.host_path }}"
|
host_path: "{{ nextcloud.networkmount.host_path }}"
|
||||||
args: "{{ nextcloud.networkmount.args }}"
|
args: "{{ nextcloud.networkmount.args }}"
|
||||||
@ -42,6 +49,16 @@
|
|||||||
(['drawio'] if nextcloud.drawio.url | default('') else []) }}
|
(['drawio'] if nextcloud.drawio.url | default('') else []) }}
|
||||||
register: _compose_result
|
register: _compose_result
|
||||||
|
|
||||||
|
- name: is nextcloud already setup?
|
||||||
|
community.docker.docker_container_exec:
|
||||||
|
container: "{{ nextcloud_container }}"
|
||||||
|
chdir: "/var/www/html/"
|
||||||
|
user: "www-data"
|
||||||
|
command: php occ status
|
||||||
|
register: nextcloud_status_check
|
||||||
|
retries: 3
|
||||||
|
changed_when: "false"
|
||||||
|
|
||||||
- name: import config
|
- name: import config
|
||||||
community.docker.docker_container_exec:
|
community.docker.docker_container_exec:
|
||||||
container: "{{ nextcloud_container }}"
|
container: "{{ nextcloud_container }}"
|
||||||
@ -49,3 +66,9 @@
|
|||||||
user: "www-data"
|
user: "www-data"
|
||||||
command: "php occ config:import /tmp/importconfig.json"
|
command: "php occ config:import /tmp/importconfig.json"
|
||||||
when: "_importconfig.changed or 'installed: false' in nextcloud_status_check.stdout"
|
when: "_importconfig.changed or 'installed: false' in nextcloud_status_check.stdout"
|
||||||
|
|
||||||
|
- name: Ensure nextcloud cron exists
|
||||||
|
cron:
|
||||||
|
name: Nextcloud periodic tasks
|
||||||
|
minute: "*/5"
|
||||||
|
job: "docker exec -u 33 {{ nextcloud_container }} php cron.php"
|
||||||
|
|||||||
@ -103,7 +103,6 @@ services:
|
|||||||
traefik.http.routers.collabora.tls.certResolver: hetzner
|
traefik.http.routers.collabora.tls.certResolver: hetzner
|
||||||
traefik.http.services.collabora-https.loadbalancer.server.port: 9980
|
traefik.http.services.collabora-https.loadbalancer.server.port: 9980
|
||||||
traefik.http.services.collabora-https.loadbalancer.passHostHeader: true
|
traefik.http.services.collabora-https.loadbalancer.passHostHeader: true
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if nextcloud.drawio.url %}
|
{% if nextcloud.drawio.url %}
|
||||||
@ -118,6 +117,7 @@ services:
|
|||||||
traefik.http.routers.drawio.tls: true
|
traefik.http.routers.drawio.tls: true
|
||||||
traefik.http.routers.drawio.tls.certResolver: hetzner
|
traefik.http.routers.drawio.tls.certResolver: hetzner
|
||||||
traefik.http.services.drawio-https.loadbalancer.server.port: 8080
|
traefik.http.services.drawio-https.loadbalancer.server.port: 8080
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
proxy:
|
proxy:
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
},
|
},
|
||||||
"upgrade.disable-web": true,
|
"upgrade.disable-web": true,
|
||||||
"instanceid": "ocm6kh4i5s9r",
|
"instanceid": "ocm6kh4i5s9r",
|
||||||
"passwordsalt": "{{ nextcloud.secretsalt }}",
|
"passwordsalt": "{{ nextcloud.secret_salt }}",
|
||||||
"secret": "{{ nextcloud.secret }}",
|
"secret": "{{ nextcloud.secret }}",
|
||||||
"apache_disable_rewrite_ip": true,
|
"apache_disable_rewrite_ip": true,
|
||||||
"trusted_proxies": [
|
"trusted_proxies": [
|
||||||
@ -20,9 +20,7 @@
|
|||||||
"{{ nextcloud.url }}"
|
"{{ nextcloud.url }}"
|
||||||
],
|
],
|
||||||
"overwrite.cli.url": "https://{{ nextcloud.url }}",
|
"overwrite.cli.url": "https://{{ nextcloud.url }}",
|
||||||
"overwriteprotocol": "https",
|
"overwriteprotocol": "https"{% if nextcloud.oidc.issuer | default('') %},
|
||||||
|
|
||||||
{% if nextcloud.oidc.issuer -%}
|
|
||||||
"oidc_login_provider_url": "{{ nextcloud.oidc.issuer }}",
|
"oidc_login_provider_url": "{{ nextcloud.oidc.issuer }}",
|
||||||
"oidc_login_client_id": "{{ nextcloud.oidc.client_id }}",
|
"oidc_login_client_id": "{{ nextcloud.oidc.client_id }}",
|
||||||
"oidc_login_client_secret": "{{ nextcloud.oidc.client_secret }}",
|
"oidc_login_client_secret": "{{ nextcloud.oidc.client_secret }}",
|
||||||
@ -31,22 +29,18 @@
|
|||||||
"oidc_login_end_session_redirect": true,
|
"oidc_login_end_session_redirect": true,
|
||||||
"oidc_login_hide_password_form": false,
|
"oidc_login_hide_password_form": false,
|
||||||
"oidc_login_use_id_token": false,
|
"oidc_login_use_id_token": false,
|
||||||
|
|
||||||
"oidc_login_attributes": {
|
"oidc_login_attributes": {
|
||||||
"id": "{{ nextcloud.oidc.id_attribute }}",
|
"id": "{{ nextcloud.oidc.id_attribute }}",
|
||||||
"name": "name",
|
"name": "name",
|
||||||
"mail": "email",
|
"mail": "email",
|
||||||
"quota": "{{ nextcloud.oidc.id_attribute }}",
|
"quota": "{{ nextcloud.oidc.id_attribute }}"
|
||||||
},
|
},
|
||||||
"oidc_login_scope": "email profile nextcloud openid",
|
"oidc_login_scope": "email profile nextcloud openid",
|
||||||
|
|
||||||
"oidc_login_proxy_ldap": false,
|
"oidc_login_proxy_ldap": false,
|
||||||
"oidc_login_disable_registration": false,
|
"oidc_login_disable_registration": false,
|
||||||
"oidc_login_password_authentication": true,
|
"oidc_login_password_authentication": true,
|
||||||
"oidc_login_update_avatar": true,
|
"oidc_login_update_avatar": true,
|
||||||
"oidc_create_groups": true,
|
"oidc_create_groups": true{% endif %},
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
"datadirectory": "/var/www/html/data",
|
"datadirectory": "/var/www/html/data",
|
||||||
"dbtype": "mysql",
|
"dbtype": "mysql",
|
||||||
"version": "32.0.5.0",
|
"version": "32.0.5.0",
|
||||||
@ -72,15 +66,15 @@
|
|||||||
"opcache.revalidate_freq": 60,
|
"opcache.revalidate_freq": 60,
|
||||||
"default_phone_region": "DE",
|
"default_phone_region": "DE",
|
||||||
"memories.gis_type": 1,
|
"memories.gis_type": 1,
|
||||||
"mail_domain": "{{ mail.address.split('@')[-1] }}",
|
"mail_domain": "{{ nextcloud.mail.address.split('@')[-1] }}",
|
||||||
"mail_from_address": "noreply",
|
"mail_from_address": "noreply",
|
||||||
"mail_smtpmode": "smtp",
|
"mail_smtpmode": "smtp",
|
||||||
"mail_smtphost": "{{ mail.host }}",
|
"mail_smtphost": "{{ nextcloud.mail.host }}",
|
||||||
"mail_smtpport": "587",
|
"mail_smtpport": "587",
|
||||||
"mail_sendmailmode": "smtp",
|
"mail_sendmailmode": "smtp",
|
||||||
"mail_smtpauth": true,
|
"mail_smtpauth": true,
|
||||||
"mail_smtpname": "{{ mail.address }}",
|
"mail_smtpname": "{{ nextcloud.mail.address }}",
|
||||||
"mail_smtppassword": "{{ mail.password }}",
|
"mail_smtppassword": "{{ nextcloud.mail.password }}",
|
||||||
"user_oidc": {
|
"user_oidc": {
|
||||||
"auto_provision": true
|
"auto_provision": true
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user