From b04d8b705b2f028bcbfb9f94ea0cb12e29554f55 Mon Sep 17 00:00:00 2001 From: phil Date: Sat, 26 Jun 2021 11:42:17 +0200 Subject: [PATCH] Umstrukturierung: Trenne allgemeine von loop-Aufgaben --- tasks/apache.yml | 10 ------- tasks/apache_common.yml | 22 +++++++++++++++ tasks/main.yml | 62 ++++------------------------------------- tasks/redis.yml | 4 +-- 4 files changed, 30 insertions(+), 68 deletions(-) create mode 100644 tasks/apache_common.yml diff --git a/tasks/apache.yml b/tasks/apache.yml index 862497c..660dfe3 100644 --- a/tasks/apache.yml +++ b/tasks/apache.yml @@ -1,14 +1,4 @@ --- -- name: "apache: {{ instance.domain }}: Module laden" - apache2_module: - state: present - name: "{{ item }}" - with_items: - - macro - - proxy_fcgi - - setenvif - notify: restart apache - - name: "apache: {{ instance.domain }}: Seite einrichten" lineinfile: path: /etc/apache2/conf-available/nextcloud_sites.conf diff --git a/tasks/apache_common.yml b/tasks/apache_common.yml new file mode 100644 index 0000000..4055c73 --- /dev/null +++ b/tasks/apache_common.yml @@ -0,0 +1,22 @@ +--- +- name: "apache_common: Module laden" + apache2_module: + state: present + name: "{{ item }}" + with_items: + - macro + - proxy_fcgi + - setenvif + notify: restart apache + +- name: "apache_common: Vorlage für Seitenkonfiguration kopieren" + copy: + src: roles/nextcloud/files/apache_site.conf + dest: /etc/apache2/sites-available/nextcloud.conf + +- name: "apache_common: Seitenkonfiguration aktivieren" + file: + src: /etc/apache2/sites-available/nextcloud.conf + dest: /etc/apache2/sites-enabled/nextcloud.conf + state: link + notify: reload apache diff --git a/tasks/main.yml b/tasks/main.yml index ad8f45a..ca6b169 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,62 +1,12 @@ --- -- name: "Versionen prüfen" - include_tasks: version.yml - tags: version - loop: "{{ instances }}" - loop_control: - loop_var: instance - -- import_tasks: packages.yml - -- name: "Gateway einrichten" - include_tasks: gateway.yml - loop: "{{ instances }}" - loop_control: - loop_var: instance - -- name: "Datenbank einrichten" - include_tasks: database.yml - tags: database - loop: "{{ instances }}" - loop_control: - loop_var: instance - -- name: "PHP-FPM einrichten" - include_tasks: php.yml - loop: "{{ instances }}" - loop_control: - loop_var: instance - -- name: "Apache: Vorlage für Seitenkonfiguration kopieren" - copy: - src: apache_site.conf - dest: /etc/apache2/sites-available/nextcloud.conf - -- name: "Webserver einrichten" - include_tasks: apache.yml - loop: "{{ instances }}" - loop_control: - loop_var: instance - -- name: "Apache: Seitenkonfiguration aktivieren" - file: - src: /etc/apache2/sites-available/nextcloud.conf - dest: /etc/apache2/sites-enabled/nextcloud.conf - state: link - -- import_tasks: redis.yml +- import_tasks: version.yml +- import_tasks: gateway.yml +- import_tasks: database.yml +- import_tasks: php.yml +- import_tasks: apache.yml - name: "Nextcloud einrichten" include_tasks: nextcloud.yml - tags: nextcloud - loop: "{{ instances }}" - loop_control: - loop_var: instance when: nc_is_installed.stat.exists == False -- name: "Hotfixes installieren" - include_tasks: fixes.yml - tags: fixes - loop: "{{ instances }}" - loop_control: - loop_var: instance +- import_tasks: fixes.yml diff --git a/tasks/redis.yml b/tasks/redis.yml index bb9a736..8d82017 100644 --- a/tasks/redis.yml +++ b/tasks/redis.yml @@ -1,11 +1,11 @@ --- -- name: "Redis Aktiviere Socket" +- name: "redis: Aktiviere Socket" lineinfile: path: /etc/redis/redis.conf regexp: '^# unixsocket /var/run/redis/redis-server.sock' line: 'unixsocket /var/run/redis/redis-server.sock' -- name: "Redis Berechtigungen" +- name: "redis: Socket-Berechtigungen stetzen" lineinfile: path: /etc/redis/redis.conf regexp: '^# unixsocketperm 700'