From 0edab01bda6126faae6550180636de6d901f2083 Mon Sep 17 00:00:00 2001 From: Andrea Cimbalo Date: Sun, 18 Jun 2017 19:30:24 +0200 Subject: [PATCH] move to php7-fpm --- roles/dokuwiki/templates/dokuwiki.conf.nginx.j2 | 2 +- .../templates/dokuwiki.conf.nginx.j2.TODO | 2 +- roles/nginx/tasks/main.yaml | 15 +++++++++++++-- roles/roundcube/templates/roundcube.conf.nginx.j2 | 3 +-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2 b/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2 index 14077d9..459c808 100644 --- a/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2 +++ b/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2 @@ -22,6 +22,6 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REDIRECT_STATUS 200; - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } } diff --git a/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2.TODO b/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2.TODO index 7724a37..b4efa10 100644 --- a/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2.TODO +++ b/roles/dokuwiki/templates/dokuwiki.conf.nginx.j2.TODO @@ -31,6 +31,6 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REDIRECT_STATUS 200; - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } } diff --git a/roles/nginx/tasks/main.yaml b/roles/nginx/tasks/main.yaml index 76e6acd..250a4b5 100644 --- a/roles/nginx/tasks/main.yaml +++ b/roles/nginx/tasks/main.yaml @@ -13,14 +13,23 @@ state: absent notify: restart nginx -- name: install php5-fpm +- name: install php-fpm apt: name: "{{ item }}" state: present update_cache: yes cache_valid_time: 3600 with_items: - - php5-fpm + - php-fpm + when: php | bool + notify: + - restart nginx + +- name: add timezone to php.ini + lineinfile: + dest: /etc/php/7.0/fpm/php.ini + regexp: '^;?date.timezone =' + line: 'date.timezone = Europe/Berlin' when: php | bool notify: - restart nginx @@ -38,6 +47,8 @@ src: "roles/{{ parent_role_path }}/templates/{{ item }}.conf.nginx.j2" dest: /etc/nginx/sites-available/{{ item }}.conf with_items: "{{ config_names }}" + notify: + - restart nginx - name: add proxy to config_names set_fact: diff --git a/roles/roundcube/templates/roundcube.conf.nginx.j2 b/roles/roundcube/templates/roundcube.conf.nginx.j2 index 08e68e8..b5bd8db 100644 --- a/roles/roundcube/templates/roundcube.conf.nginx.j2 +++ b/roles/roundcube/templates/roundcube.conf.nginx.j2 @@ -12,8 +12,7 @@ server { location ~ \.php$ { include snippets/fastcgi-php.conf; - # With php5-fpm: - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; } #deny access to .htaccess files, if Apache's document root