diff --git a/zabbix-frontend/files/10-uwsgi.conf b/zabbix-frontend/files/10-uwsgi.conf deleted file mode 100644 index 50b2862b7b5bfbdf7fafd0f4e6a54f0280e8c743..0000000000000000000000000000000000000000 --- a/zabbix-frontend/files/10-uwsgi.conf +++ /dev/null @@ -1,2 +0,0 @@ -d /run/uwsgi 0755 root root - - -d /run/uwsgi/app 0755 root root - - diff --git a/zabbix-frontend/files/10-zabbix.conf b/zabbix-frontend/files/10-zabbix.conf deleted file mode 100644 index 4affeaeb98a241bc76c28bb4c6e5a79646c556eb..0000000000000000000000000000000000000000 --- a/zabbix-frontend/files/10-zabbix.conf +++ /dev/null @@ -1 +0,0 @@ -d /run/uwsgi/app/zabbix 0775 zabbix zabbix - - diff --git a/zabbix-frontend/handlers/main.yml b/zabbix-frontend/handlers/main.yml index 6384a25d5e74ece7f020d488f7163c8fbcb47e44..8f871da3677fe3f5f55a9e4f637ae407f1be6af1 100644 --- a/zabbix-frontend/handlers/main.yml +++ b/zabbix-frontend/handlers/main.yml @@ -1,7 +1,7 @@ --- - name: restart zabbix frontend - service: name=zabbix-frontend state=restarted + systemd: name=php7.0-fpm.service state=restarted - name: create tmpfiles command: systemd-tmpfiles --create diff --git a/zabbix-frontend/meta/main.yml b/zabbix-frontend/meta/main.yml index 6e367136fed2bd31c49780836a46994cadf6c6a8..76d5cae9bae82a45db794d9ce36e51b22e1e0cb3 100644 --- a/zabbix-frontend/meta/main.yml +++ b/zabbix-frontend/meta/main.yml @@ -2,5 +2,5 @@ dependencies: - role: zabbix-repo - role: webserver - - role: uwsgi-php + - { role: php-fpm, fpm_pool: zabbix, fpm_user: zabbix, fpm_group: zabbix, fpm_socket_user: zabbix, fpm_socket_group: www-data, fpm_params: { date.timezone: "Europe/Berlin", post_max_size: "16M", max_execution_time: 300, max_input_time: 300, always_populate_raw_post_data: -1 } } # TODO webserver fails ansible on initial deployment currently by purpose diff --git a/zabbix-frontend/tasks/main.yml b/zabbix-frontend/tasks/main.yml index 08bae50ba63f7514bcf15778ef16b9bd4ad2f711..9340c5bf98e169a57923a534416fc0d2f7059e51 100644 --- a/zabbix-frontend/tasks/main.yml +++ b/zabbix-frontend/tasks/main.yml @@ -1,30 +1,5 @@ --- -- name: ensure there is an uwsgi temporary directory - copy: src=10-uwsgi.conf dest=/etc/tmpfiles.d/10-uwsgi.conf - notify: - - create tmpfiles - tags: - - config - - zabbix - -- name: ensure there is an frontend app temporary directory - copy: src=10-zabbix.conf dest=/etc/tmpfiles.d/10-zabbix.conf - notify: - - create tmpfiles - tags: - - config - - zabbix - -- name: ensure the systemd service file is available - copy: src=zabbix-frontend.service dest=/etc/systemd/system/zabbix-frontend.service - notify: - - reload systemd service files - - restart zabbix frontend - tags: - - service - - zabbix - - name: ensure the frontend package is installed apt: name=zabbix-frontend-php state=latest notify: @@ -41,14 +16,6 @@ - packages - zabbix -- name: ensure the frontend app got some uwsgi config - copy: src=zabbix.ini dest=/etc/uwsgi/apps-available/zabbix.ini - notify: - - restart zabbix frontend - tags: - - config - - zabbix - - name: ensure a user executing the app exists user: name=zabbix system=yes home=/usr/share/zabbix shell=/usr/sbin/nologin createhome=no group=zabbix state=present notify: @@ -57,36 +24,6 @@ - user - zabbix -- name: ensure an nginx config file is available - copy: src=zabbix.conf dest=/etc/nginx/sites-available/zabbix.conf - when: zabbix_configure_webserver - notify: - - restart nginx - tags: - - config - - zabbix - - nginx - -- name: ensure the frontend is enabled in nginx - lineinfile: dest=/etc/nginx/sites-available/main line="include /etc/nginx/sites-available/zabbix.conf;" insertbefore="}" - when: zabbix_configure_webserver - notify: - - restart nginx - tags: - - config - - zabbix - - nginx - -- name: ensure the frontend configuration file is installed - template: src=zabbix.conf.php.j2 dest=/etc/zabbix/web/zabbix.conf.php - when: zabbix_configure_webserver - notify: - - restart zabbix frontend - tags: - - config - - zabbix - - nginx - - name: ensure the database server listens on the external interface replace: dest=/etc/postgresql/9.6/main/postgresql.conf regexp="#listen_addresses = 'localhost'" replace="listen_addresses = '*'" notify: @@ -106,11 +43,3 @@ - zabbix - meta: flush_handlers - -- name: ensure the frontend is enabled and running - service: name=zabbix-frontend state=running enabled=yes - tags: - - service - - zabbix - -- meta: flush_handlers