working: ansible
This commit is contained in:
parent
68e8d0de54
commit
9b8651b17a
@ -1,9 +1,8 @@
|
||||
- name: restart container
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ path }}"
|
||||
project_name: "{{ role_name }}"
|
||||
recreate: "always"
|
||||
services: ["nextcloud"]
|
||||
state: "restarted"
|
||||
when: not _nextcloud_already_restarted
|
||||
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ path }}"
|
||||
project_name: "{{ role_name }}"
|
||||
recreate: "always"
|
||||
services: ["nextcloud"]
|
||||
state: "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.
|
||||
# Maximum 20 tags per role.
|
||||
|
||||
# dependencies:
|
||||
# - role: base
|
||||
dependencies:
|
||||
- role: traefik
|
||||
|
||||
@ -3,9 +3,16 @@
|
||||
set_fact:
|
||||
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
|
||||
file:
|
||||
path: "{{ path }}/config/nextcloud"
|
||||
path: "{{ path }}/config/"
|
||||
state: directory
|
||||
|
||||
- name: template compose
|
||||
@ -16,13 +23,13 @@
|
||||
- name: template nc config
|
||||
template:
|
||||
src: importconfig.json.j2
|
||||
dest: "{{ path }}/config/nextcloud/importconfig.json"
|
||||
dest: "{{ path }}/config/nextcloud-importconfig.json"
|
||||
register: _importconfig
|
||||
|
||||
- import_role:
|
||||
name: storage_mount
|
||||
vars:
|
||||
storagebox_override:
|
||||
storage_mount_override:
|
||||
host: "{{ nextcloud.networkmount.host }}"
|
||||
host_path: "{{ nextcloud.networkmount.host_path }}"
|
||||
args: "{{ nextcloud.networkmount.args }}"
|
||||
@ -42,10 +49,26 @@
|
||||
(['drawio'] if nextcloud.drawio.url | default('') else []) }}
|
||||
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
|
||||
community.docker.docker_container_exec:
|
||||
container: "{{ nextcloud_container }}"
|
||||
chdir: "/var/www/html/"
|
||||
user: "www-data"
|
||||
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.services.collabora-https.loadbalancer.server.port: 9980
|
||||
traefik.http.services.collabora-https.loadbalancer.passHostHeader: true
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if nextcloud.drawio.url %}
|
||||
@ -118,6 +117,7 @@ services:
|
||||
traefik.http.routers.drawio.tls: true
|
||||
traefik.http.routers.drawio.tls.certResolver: hetzner
|
||||
traefik.http.services.drawio-https.loadbalancer.server.port: 8080
|
||||
{% endif %}
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
},
|
||||
"upgrade.disable-web": true,
|
||||
"instanceid": "ocm6kh4i5s9r",
|
||||
"passwordsalt": "{{ nextcloud.secretsalt }}",
|
||||
"passwordsalt": "{{ nextcloud.secret_salt }}",
|
||||
"secret": "{{ nextcloud.secret }}",
|
||||
"apache_disable_rewrite_ip": true,
|
||||
"trusted_proxies": [
|
||||
@ -20,9 +20,7 @@
|
||||
"{{ nextcloud.url }}"
|
||||
],
|
||||
"overwrite.cli.url": "https://{{ nextcloud.url }}",
|
||||
"overwriteprotocol": "https",
|
||||
|
||||
{% if nextcloud.oidc.issuer -%}
|
||||
"overwriteprotocol": "https"{% if nextcloud.oidc.issuer | default('') %},
|
||||
"oidc_login_provider_url": "{{ nextcloud.oidc.issuer }}",
|
||||
"oidc_login_client_id": "{{ nextcloud.oidc.client_id }}",
|
||||
"oidc_login_client_secret": "{{ nextcloud.oidc.client_secret }}",
|
||||
@ -31,22 +29,18 @@
|
||||
"oidc_login_end_session_redirect": true,
|
||||
"oidc_login_hide_password_form": false,
|
||||
"oidc_login_use_id_token": false,
|
||||
|
||||
"oidc_login_attributes": {
|
||||
"id": "{{ nextcloud.oidc.id_attribute }}",
|
||||
"name": "name",
|
||||
"mail": "email",
|
||||
"quota": "{{ nextcloud.oidc.id_attribute }}",
|
||||
"quota": "{{ nextcloud.oidc.id_attribute }}"
|
||||
},
|
||||
"oidc_login_scope": "email profile nextcloud openid",
|
||||
|
||||
"oidc_login_proxy_ldap": false,
|
||||
"oidc_login_disable_registration": false,
|
||||
"oidc_login_password_authentication": true,
|
||||
"oidc_login_update_avatar": true,
|
||||
"oidc_create_groups": true,
|
||||
{%- endif %}
|
||||
|
||||
"oidc_create_groups": true{% endif %},
|
||||
"datadirectory": "/var/www/html/data",
|
||||
"dbtype": "mysql",
|
||||
"version": "32.0.5.0",
|
||||
@ -72,15 +66,15 @@
|
||||
"opcache.revalidate_freq": 60,
|
||||
"default_phone_region": "DE",
|
||||
"memories.gis_type": 1,
|
||||
"mail_domain": "{{ mail.address.split('@')[-1] }}",
|
||||
"mail_domain": "{{ nextcloud.mail.address.split('@')[-1] }}",
|
||||
"mail_from_address": "noreply",
|
||||
"mail_smtpmode": "smtp",
|
||||
"mail_smtphost": "{{ mail.host }}",
|
||||
"mail_smtphost": "{{ nextcloud.mail.host }}",
|
||||
"mail_smtpport": "587",
|
||||
"mail_sendmailmode": "smtp",
|
||||
"mail_smtpauth": true,
|
||||
"mail_smtpname": "{{ mail.address }}",
|
||||
"mail_smtppassword": "{{ mail.password }}",
|
||||
"mail_smtpname": "{{ nextcloud.mail.address }}",
|
||||
"mail_smtppassword": "{{ nextcloud.mail.password }}",
|
||||
"user_oidc": {
|
||||
"auto_provision": true
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user