Support FreeBSD 11/12

This commit is contained in:
Emilien Mantel
2018-03-18 21:29:47 +01:00
parent e87d158424
commit 9aa0f76c03
17 changed files with 205 additions and 57 deletions

View File

@@ -1,14 +1,23 @@
---
- name: APT | Install PHP-FPM
- name: APT | Install PHP-FPM for Debian based systems
apt:
pkg: "{{ php_fpm_service }}"
state: "{{ 'present' if php_install_fpm else 'absent' }}"
when: ansible_os_family == 'Debian'
- name: SERVICE | Enable service on FreeBSD
service:
name: "{{ php_fpm_service }}"
enabled: "{{ 'yes' if php_install_fpm else 'no' }}"
when: ansible_os_family == 'FreeBSD'
- name: LINEINFILE | PHP configuration
lineinfile:
dest: '{{ php_cli_ini }}'
regexp: '^;?{{ item.key }}'
line: '{{ item.key }} = {{ item.value }}'
create: yes
with_dict: "{{ php_ini | combine(php_ini_fpm) }}"
notify: restart php-fpm

View File

@@ -16,17 +16,26 @@
- "{{ php_packages }}"
- "{{ php_extra_packages }}"
notify: restart php-fpm
when: ansible_os_family == 'Debian'
- name: PKGNG | Install PHP packages
pkgng:
name: "{{ item }}"
with_flattened:
- "{{ php_packages }}"
- "{{ php_extra_packages }}"
notify: restart php-fpm
when: ansible_os_family == 'FreeBSD'
- name: INCLUDE | PHP-FPM
include: fpm.yml
when: php_install_fpm
- name: LINEINFILE | PHP configuration
- name: LINEINFILE | PHP CLI configuration
lineinfile:
dest: '{{ php_cli_ini }}'
regexp: '^;?{{ item.key }}'
line: '{{ item.key }} = {{ item.value }}'
with_dict: "{{ php_ini_cli }}"
with_dict: "{{ php_ini | combine(php_ini_cli) }}"
- name: INCLUDE | Xdebug
include: xdebug.yml

View File

@@ -1,12 +1,28 @@
---
- name: APT | Install APCu
apt:
pkg: "{{ php_package_prefix }}apcu"
- block:
- name: APT | Install Opcache
apt:
pkg: "{{ php_package_prefix }}opcache"
- name: APT | Install APCu
apt:
pkg: "{{ php_package_prefix }}apcu"
- name: APT | Install Opcache
apt:
pkg: "{{ php_package_prefix }}opcache"
when: ansible_os_family == 'Debian'
- block:
- name: PKGNG | Install APCu
pkgng:
name: "php{{ php_version | replace('.', '') }}-pecl-APCu"
- name: PKGNG | Install Opcache
pkgng:
name: "{{ php_package_prefix }}opcache"
when: ansible_os_family == 'FreeBSD'
- name: TEMPLATE | Configure Opcache
template:

View File

@@ -2,12 +2,18 @@
- block:
- name: APT | Install php-xdebug
- name: APT | Install xdebug
apt:
pkg: "{{ php_package_prefix }}xdebug"
pkg: "{{ php_xdebug_package }}"
state: present
update_cache: yes
cache_valid_time: 3600
when: ansible_os_family == 'Debian'
- name: PKGNG | Install xdebug
pkgng:
name: "{{ php_xdebug_package }}"
when: ansible_os_family == 'FreeBSD' and php_xdebug_package is defined
- name: TEMPLATE | Deploy module configurations
template:
@@ -19,8 +25,17 @@
when: php_install_xdebug
- name: APT | Uninstall php-xdebug
apt:
pkg: "{{ php_package_prefix }}xdebug"
state: absent
- block:
- name: APT | Uninstall xdebug
apt:
pkg: "{{ php_xdebug_package }}"
state: absent
when: ansible_os_family == 'Debian'
- name: PKGNG | Install xdebug
pkgng:
name: "{{ php_xdebug_package }}"
when: ansible_os_family == 'FreeBSD' and php_xdebug_package is defined
when: not php_install_xdebug