From c13cb0d7704a1871d9f4d007c25d8bf2592e2988 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Sat, 5 Mar 2016 17:26:05 +0100 Subject: [PATCH] PHP works on FreeBSD --- tasks/install_FreeBSD.yml | 17 +++++++++++++---- tests/includes/pre_FreeBSD.yml | 17 +++++++++++++++++ tests/test.yml | 2 ++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/tasks/install_FreeBSD.yml b/tasks/install_FreeBSD.yml index c6c30c6..94b10bb 100644 --- a/tasks/install_FreeBSD.yml +++ b/tasks/install_FreeBSD.yml @@ -14,11 +14,20 @@ - sites-available - sites-enabled -- name: FILE | Follow Debian ;) - file: > - src="{{ nginx_etc_dir }}/fastcgi_params" +- name: STAT | Check fastcgi.conf + stat: path={{ nginx_etc_dir }}/fastcgi.conf + register: conf + +- name: COPY | config + command: "cp {{ nginx_etc_dir }}/fastcgi_params {{ nginx_etc_dir }}/fastcgi.conf" + when: not conf.stat.exists + notify: reload nginx + +- name: LINEINFILE | Add fastcgi config + lineinfile: > + line="fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;" dest="{{ nginx_etc_dir }}/fastcgi.conf" - state=link + notify: reload nginx - name: COPY | Populate proxy_params copy: > diff --git a/tests/includes/pre_FreeBSD.yml b/tests/includes/pre_FreeBSD.yml index 8ec7448..6555bf1 100644 --- a/tests/includes/pre_FreeBSD.yml +++ b/tests/includes/pre_FreeBSD.yml @@ -3,3 +3,20 @@ - name: SET_FACT | FreeBSD web user set_fact: nginx_user: 'www' + nginx_php_sockets: + - host: '127.0.0.1' + port: 9000 + +- name: PKGNG | Install needed packages + pkgng: pkg={{ item }} state=present + with_items: + - php56 + - curl + - fcgiwrap + +- name: SERVICE | Force start services + service: name={{ item }} state=started enabled=yes + register: sf + with_items: + - php-fpm + - fcgiwrap diff --git a/tests/test.yml b/tests/test.yml index bbbb91a..7dadbd1 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -141,6 +141,8 @@ redirect_from: - 'www.test-php.local' template: '_php' + use_error_log: true + use_access_log: true - name: 'test-php-index.local' template: '_php_index' - name: 'test-proxy.local'