ansible-role-nextcloud/tasks/webserver.yml

59 lines
1.8 KiB
YAML
Raw Permalink Normal View History

2023-10-25 18:04:18 +02:00
---
- name: "Konfiguriere Apache"
when: nextcloud_webserver == "Apache"
tags: apache
block:
- name: "Webserver | Aktiviere Apache-Module"
community.general.apache2_module:
name: "{{ item.name }}"
state: "{{ item.state | default('present') }}"
loop:
- name: env
- name: expires
- name: headers
- name: macro
- name: mpm_event
- name: mpm_prefork
state: absent
- name: proxy_fcgi
- name: setenvif
notify: restart apache
- name: "Webserver | Richte Nextcloud-Seiten ein"
ansible.builtin.template:
src: apache2/nextcloud_sites.conf.j2
dest: /etc/apache2/conf-available/nextcloud_sites.conf
mode: "0644"
notify: reload apache
- name: "Webserver | Kopiere Apache-Vorlage für Seitenkonfiguration"
ansible.builtin.template:
src: apache2/nextcloud.conf.j2
dest: /etc/apache2/sites-available/nextcloud.conf
mode: "0644"
- name: "Webserver | Aktiviere Apache-Seitenkonfiguration"
ansible.builtin.command:
cmd: a2ensite nextcloud.conf
creates: /etc/apache2/sites-enabled/nextcloud.conf
notify: reload apache
- name: "Konfiguriere Nginx"
when: nextcloud_webserver == "Nginx"
tags: nginx
notify: Reload nginx
block:
- name: "Webserver | Kopiere Nginx-Konfiguration"
ansible.builtin.template:
src: nginx/nginx.conf
dest: "/etc/nginx/sites-available/{{ item.name }}"
mode: "0644"
2023-10-25 18:35:43 +02:00
loop: "{{ nextcloud_instances }}"
2023-10-25 18:04:18 +02:00
- name: "Webserver | Aktiviere Nginx-Konfiguration"
ansible.builtin.file:
src: "/etc/nginx/sites-available/{{ item.name }}"
dest: "/etc/nginx/sites-enabled/{{ item.name }}"
state: link
2023-10-25 18:35:43 +02:00
loop: "{{ nextcloud_instances }}"