2015-06-19 20:44:53 +02:00
|
|
|
{% from "apache/map.jinja" import apache with context %}
|
2013-08-13 22:30:49 +02:00
|
|
|
|
2013-07-29 23:29:41 +02:00
|
|
|
include:
|
2013-11-05 21:05:28 +01:00
|
|
|
- apache
|
2013-07-29 23:29:41 +02:00
|
|
|
|
|
|
|
mod-php5:
|
|
|
|
pkg.installed:
|
2015-06-19 20:44:53 +02:00
|
|
|
- name: {{ apache.mod_php5 }}
|
2013-07-29 23:29:41 +02:00
|
|
|
- order: 180
|
|
|
|
- require:
|
2013-07-29 23:30:29 +02:00
|
|
|
- pkg: apache
|
2013-07-29 23:29:41 +02:00
|
|
|
|
2015-06-19 20:44:53 +02:00
|
|
|
{% if grains['os_family']=="Debian" %}
|
2013-07-29 23:29:41 +02:00
|
|
|
a2enmod php5:
|
|
|
|
cmd.run:
|
|
|
|
- unless: ls /etc/apache2/mods-enabled/php5.load
|
2013-07-29 23:32:16 +02:00
|
|
|
- order: 225
|
2013-07-29 23:29:41 +02:00
|
|
|
- require:
|
|
|
|
- pkg: mod-php5
|
|
|
|
- watch_in:
|
2014-01-04 23:46:47 +01:00
|
|
|
- module: apache-restart
|
2018-11-09 00:25:52 +01:00
|
|
|
- require_in:
|
|
|
|
- module: apache-restart
|
|
|
|
- module: apache-reload
|
|
|
|
- service: apache
|
2013-07-29 23:29:41 +02:00
|
|
|
|
2013-07-29 23:31:15 +02:00
|
|
|
{% if 'apache' in pillar and 'php-ini' in pillar['apache'] %}
|
2013-07-29 23:29:41 +02:00
|
|
|
/etc/php5/apache2/php.ini:
|
|
|
|
file.managed:
|
2013-07-29 23:31:15 +02:00
|
|
|
- source: {{ pillar['apache']['php-ini'] }}
|
2013-07-29 23:29:41 +02:00
|
|
|
- order: 225
|
|
|
|
- watch_in:
|
2014-01-04 23:46:47 +01:00
|
|
|
- module: apache-restart
|
2018-11-09 00:25:52 +01:00
|
|
|
- require_in:
|
|
|
|
- module: apache-restart
|
|
|
|
- module: apache-reload
|
|
|
|
- service: apache
|
2013-07-29 23:29:41 +02:00
|
|
|
- require:
|
2013-07-29 23:30:29 +02:00
|
|
|
- pkg: apache
|
2014-12-29 03:25:08 +01:00
|
|
|
- pkg: mod-php5
|
2013-07-29 23:29:41 +02:00
|
|
|
{% endif %}
|
|
|
|
|
2016-09-27 02:16:21 +02:00
|
|
|
{% elif grains['os_family']=="FreeBSD" %}
|
|
|
|
|
|
|
|
{{ apache.modulesdir }}/050_mod_php5.conf:
|
|
|
|
file.managed:
|
|
|
|
- source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_php5.conf.jinja
|
|
|
|
- mode: 644
|
|
|
|
- template: jinja
|
|
|
|
- require:
|
|
|
|
- pkg: apache
|
|
|
|
- watch_in:
|
|
|
|
- module: apache-restart
|
2018-11-09 00:25:52 +01:00
|
|
|
- require_in:
|
|
|
|
- module: apache-restart
|
|
|
|
- module: apache-reload
|
|
|
|
- service: apache
|
2016-09-27 02:16:21 +02:00
|
|
|
|
2013-07-29 23:29:41 +02:00
|
|
|
{% endif %}
|
2017-01-22 22:50:33 +01:00
|
|
|
|
2017-08-24 12:41:05 +02:00
|
|
|
{% if grains['os_family']=="Suse" or salt['grains.get']('os') == 'SUSE' %}
|
2017-01-22 22:50:33 +01:00
|
|
|
/etc/sysconfig/apache2:
|
|
|
|
file.replace:
|
|
|
|
- unless: grep '^APACHE_MODULES=.*php5' /etc/sysconfig/apache2
|
|
|
|
- pattern: '^APACHE_MODULES=(.*)"'
|
|
|
|
- repl: 'APACHE_MODULES=\1 php5"'
|
|
|
|
{% endif %}
|