2020-09-17 02:16:55 +02:00
|
|
|
---
|
|
|
|
- name: Install deps
|
|
|
|
package:
|
|
|
|
state: latest
|
|
|
|
name:
|
|
|
|
- mariadb-server
|
|
|
|
- redis
|
|
|
|
- sendmail-bin
|
2021-07-11 23:43:16 +02:00
|
|
|
- libmagickcore-6.q16-6-extra
|
2020-09-17 02:16:55 +02:00
|
|
|
|
|
|
|
- name: get and unzip nextcloud
|
|
|
|
unarchive:
|
|
|
|
src: "{{ nextcloud_url_download }}"
|
|
|
|
dest: /var/www/
|
|
|
|
owner: www-data
|
|
|
|
group: www-data
|
|
|
|
remote_src: yes
|
|
|
|
creates: /var/www/nextcloud
|
|
|
|
|
|
|
|
- name: config nextcloud
|
|
|
|
lineinfile:
|
|
|
|
path: "/var/www/nextcloud/config/config.php"
|
|
|
|
regex: ".*'{{ item.key }}'.*=>.*"
|
|
|
|
insertbefore: "\\);"
|
|
|
|
line: " '{{ item.key }}' => {{ item.value }},"
|
|
|
|
with_items:
|
|
|
|
- key: "datadirectory"
|
|
|
|
value: "'/data'"
|
|
|
|
- key: "redis"
|
|
|
|
value: "array('host' => '127.0.0.1', 'port' => 6379)"
|
|
|
|
- key: "memcache.local"
|
|
|
|
value: "'\\\\OC\\\\Memcache\\\\Redis'"
|
|
|
|
- key: "memcache.distributed"
|
|
|
|
value: "'\\\\OC\\\\Memcache\\\\Redis'"
|
|
|
|
- key: "memcache.locking"
|
|
|
|
value: "'\\\\OC\\\\Memcache\\\\Redis'"
|
2021-07-11 23:43:16 +02:00
|
|
|
- key: "default_phone_region"
|
|
|
|
value: "'de'"
|
2020-09-17 02:16:55 +02:00
|
|
|
|
|
|
|
- name: config acme
|
|
|
|
notify: regenerate certificates
|
|
|
|
lineinfile:
|
|
|
|
path: "/etc/dehydrated/domains.txt"
|
|
|
|
line: "{{ nextcloud_domain }}"
|
|
|
|
create: yes
|
|
|
|
|
|
|
|
- name: config webserver
|
|
|
|
notify: reload nginx
|
|
|
|
template:
|
|
|
|
src: "nginx"
|
|
|
|
dest: "/etc/nginx/sites-available/nextcloud"
|
|
|
|
mode: 660
|
|
|
|
|
|
|
|
- name: enable webserver
|
|
|
|
notify: reload nginx
|
|
|
|
file:
|
|
|
|
src: "/etc/nginx/sites-available/nextcloud"
|
|
|
|
dest: "/etc/nginx/sites-enabled/nextcloud"
|
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: Install nextcloud cronjob
|
|
|
|
template:
|
|
|
|
dest: "/etc/systemd/system/{{ item }}"
|
|
|
|
src: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- nextcloudcron.service
|
|
|
|
- nextcloudcron.timer
|
|
|
|
|
|
|
|
- name: Start nextcloud cronjob
|
|
|
|
systemd:
|
|
|
|
name: nextcloudcron.timer
|
|
|
|
state: started
|
|
|
|
enabled: yes
|