From 9df35f0c82e37e7969a15ee61372e604c0609661 Mon Sep 17 00:00:00 2001 From: Niels Abspoel Date: Wed, 25 Feb 2015 21:51:16 +0100 Subject: [PATCH] add libapache2-mod-php5 options on debian only --- php/ng/apache2/ini.sls | 9 +++++++++ php/ng/apache2/init.sls | 14 ++++++++++++++ php/ng/apache2/install.sls | 2 ++ php/ng/map.jinja | 10 ++++++++++ 4 files changed, 35 insertions(+) create mode 100644 php/ng/apache2/ini.sls create mode 100644 php/ng/apache2/init.sls create mode 100644 php/ng/apache2/install.sls diff --git a/php/ng/apache2/ini.sls b/php/ng/apache2/ini.sls new file mode 100644 index 0000000..72f02b7 --- /dev/null +++ b/php/ng/apache2/ini.sls @@ -0,0 +1,9 @@ +# Manages the libapache2-mod-php5 main ini file +{% from 'php/ng/map.jinja' import php with context %} +{% from "php/ng/ini.jinja" import php_ini %} + +{% set settings = php.ini.defaults %} +{% do settings.update(php.apache2.ini.settings) %} + +php_apache2_ini: + {{ php_ini(php.lookup.apache2.ini, php.apache2.ini.opts, settings) }} diff --git a/php/ng/apache2/init.sls b/php/ng/apache2/init.sls new file mode 100644 index 0000000..c0492bd --- /dev/null +++ b/php/ng/apache2/init.sls @@ -0,0 +1,14 @@ +# Installs libapache2-mod-php5 package and manages the associated php.ini on os Debian +{% if grains['os_family']=="Debian" %} + +include: + - php.ng.apache2.install + - php.ng.apache2.ini + +extend: + php_apache2_ini: + file: + - require: + - sls: php.ng.apache2.install + +{% endif %} #END: os = debian diff --git a/php/ng/apache2/install.sls b/php/ng/apache2/install.sls new file mode 100644 index 0000000..0f1ed17 --- /dev/null +++ b/php/ng/apache2/install.sls @@ -0,0 +1,2 @@ +{% set state = 'apache2' %} +{% include "php/ng/installed.jinja" %} diff --git a/php/ng/map.jinja b/php/ng/map.jinja index 9680fe8..cb8774e 100644 --- a/php/ng/map.jinja +++ b/php/ng/map.jinja @@ -6,6 +6,7 @@ 'apc': 'php-apc', 'cgi': 'php5-cgi', 'cli': 'php5-cli', + 'apache2': 'libapache2-mod-php5', 'curl': 'php5-curl', 'fpm': 'php5-fpm', 'gd': 'php5-gd', @@ -44,6 +45,9 @@ 'cli': { 'ini': '/etc/php5/cli/php.ini', }, + 'apache2': { + 'ini': '/etc/php5/apache2/php.ini', + }, }, 'RedHat': { 'pkgs': { @@ -114,6 +118,12 @@ 'settings': {}, } }, + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, 'ini': { 'defaults': { 'PHP': {