2021-08-07 16:46:17 +02:00
|
|
|
---
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Setze Variable"
|
|
|
|
ansible.builtin.set_fact:
|
|
|
|
nextcloud_install_path: "{{ nextcloud_root }}/{{ instances.name }}"
|
|
|
|
|
|
|
|
- name: "Configuration | Richte trusted domains ein | {{ instances.name }}"
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: 'php occ config:system:set trusted_domains {{ item.0 }} --value "{{ item.1 }}"'
|
|
|
|
chdir: "{{ nextcloud_install_path }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
become: true
|
2023-05-21 23:01:31 +02:00
|
|
|
become_user: "{{ instances.user }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
changed_when: true
|
|
|
|
with_indexed_items:
|
2023-05-21 23:01:31 +02:00
|
|
|
- '{{ instances.config.trusted_domains }}'
|
2021-08-07 16:46:17 +02:00
|
|
|
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Richte cron-Job ein | {{ instances.name }}"
|
2022-12-31 13:37:28 +01:00
|
|
|
ansible.builtin.cron:
|
2023-05-21 23:01:31 +02:00
|
|
|
name: "nextcloud {{ instances.name }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
minute: "*/5"
|
2023-05-21 23:01:31 +02:00
|
|
|
user: "{{ instances.user }}"
|
|
|
|
job: "php -f {{ nextcloud_install_path }}/cron.php"
|
2021-08-07 16:46:17 +02:00
|
|
|
cron_file: "nextcloud"
|
|
|
|
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Richte allgemeie Konfiguration ein | {{ instances.name }}"
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "{{ commands }}"
|
|
|
|
chdir: "{{ nextcloud_install_path }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
become: true
|
2023-05-21 23:01:31 +02:00
|
|
|
become_user: "{{ instances.user }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
changed_when: true
|
2023-05-21 23:01:31 +02:00
|
|
|
loop:
|
|
|
|
- 'php occ config:system:set memcache.local --value "\\OC\\Memcache\\APCu"'
|
|
|
|
- 'php occ config:system:set memcache.distributed --value "\OC\Memcache\Redis"'
|
|
|
|
- "php occ background:cron"
|
|
|
|
- 'php occ config:system:set overwrite.cli.url --value https://{{ instances.name }}'
|
|
|
|
- 'php occ config:system:set htaccess.RewriteBase --value /'
|
|
|
|
- 'php occ maintenance:update:htaccess'
|
|
|
|
- 'php occ config:system:set default_language --value "de"'
|
|
|
|
- 'php occ config:system:set default_phone_region --value "DE"'
|
|
|
|
loop_control:
|
|
|
|
loop_var: commands
|
2021-08-07 16:46:17 +02:00
|
|
|
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Richte Mailversand ein | {{ instances.name }}"
|
2022-12-31 13:37:28 +01:00
|
|
|
ansible.builtin.blockinfile:
|
2021-08-07 16:46:17 +02:00
|
|
|
path: "{{ nextcloud_config_file }}"
|
|
|
|
insertbefore: '^\);'
|
2023-08-05 20:28:46 +02:00
|
|
|
marker: "// {mark} ANSIBLE MANAGED BLOCK Mailversand"
|
2021-08-07 16:46:17 +02:00
|
|
|
block: |2
|
2023-05-21 23:01:31 +02:00
|
|
|
'mail_from_address' => '{{ instances.config.mail_from }}',
|
2021-08-07 16:46:17 +02:00
|
|
|
'mail_smtpmode' => 'smtp',
|
|
|
|
'mail_sendmailmode' => 'smtp',
|
2023-05-21 23:01:31 +02:00
|
|
|
'mail_domain' => '{{ instances.config.mail_domain }}',
|
|
|
|
'mail_smtpauthtype' => '{{ instances.config.smtp_auth_type }}',
|
|
|
|
'mail_smtphost' => '{{ instances.config.smtp_host }}',
|
|
|
|
'mail_smtpport' => '{{ instances.config.smtp_port }}',
|
2021-08-07 16:46:17 +02:00
|
|
|
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Richte Filelocking ein | {{ instances.name }}"
|
2022-12-31 13:37:28 +01:00
|
|
|
ansible.builtin.blockinfile:
|
2021-08-07 16:46:17 +02:00
|
|
|
path: "{{ nextcloud_config_file }}"
|
|
|
|
insertbefore: '^\);'
|
2023-08-05 20:28:46 +02:00
|
|
|
marker: "// {mark} ANSIBLE MANAGED BLOCK Filelocking"
|
2021-08-07 16:46:17 +02:00
|
|
|
block: |2
|
|
|
|
'filelocking.enabled' => true,
|
|
|
|
'memcache.locking' => '\OC\Memcache\Redis',
|
|
|
|
'redis' => array(
|
|
|
|
'host' => '/var/run/redis/redis-server.sock',
|
|
|
|
'port' => 0,
|
|
|
|
'dbindex' => {{ instance_id }},
|
|
|
|
'timeout' => 1.5,
|
|
|
|
),
|
|
|
|
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Richte trusted proxies ein | {{ instances.name }}"
|
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: 'php occ config:system:set trusted_proxies {{ item.0 }} --value "{{ item.1 }}"'
|
|
|
|
chdir: "{{ nextcloud_install_path }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
become: true
|
2023-05-21 23:01:31 +02:00
|
|
|
become_user: "{{ instances.user }}"
|
2021-08-07 16:46:17 +02:00
|
|
|
changed_when: true
|
|
|
|
with_indexed_items:
|
2023-05-21 23:01:31 +02:00
|
|
|
- "{{ instances.config.trusted_proxies }}"
|
2022-12-31 14:27:02 +01:00
|
|
|
|
2023-05-21 23:01:31 +02:00
|
|
|
- name: "Configuration | Richte Logging ein | {{ instances.name }}"
|
2022-12-31 14:27:02 +01:00
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: "{{ nextcloud_config_file }}"
|
|
|
|
insertbefore: '^\);'
|
2023-08-05 20:28:46 +02:00
|
|
|
marker: "// {mark} ANSIBLE MANAGED BLOCK Logging"
|
2022-12-31 14:27:02 +01:00
|
|
|
block: |2
|
|
|
|
'log_type' => 'file',
|
|
|
|
'loglevel' => 1,
|
|
|
|
'logdateformat' => 'F d, Y H:i:s',
|
|
|
|
'log_type_audit' => 'file',
|
2023-08-05 20:28:46 +02:00
|
|
|
|
|
|
|
- name: "Configuration | Erstelle OIDC-Konfiguration | {{ instances.name }}"
|
|
|
|
ansible.builtin.blockinfile:
|
|
|
|
path: "{{ nextcloud_config_file }}"
|
|
|
|
insertbefore: '^\);'
|
|
|
|
marker: "// {mark} ANSIBLE MANGED BLOCK OIDC"
|
|
|
|
block: "{{ instances.config.oidc }}"
|
|
|
|
when: instances.config.oidc is defined
|