manage xcache.ini in pillar

This commit is contained in:
Daniel Oetken 2015-10-23 23:35:05 +02:00
parent 1fdf1723af
commit 861ddd2db4
5 changed files with 90 additions and 0 deletions

View File

@ -422,6 +422,16 @@ Installs the php-suhosin package.
``php.ng.xcache`` ``php.ng.xcache``
--------------- ---------------
Meta-state that combines `php.ng.xcache.install`_ and `php.ng.xcache.ini`_.
``php.ng.xcache.ini``
---------------
Manages the php-xcache ini file
``php.ng.xcache.install``
---------------
Installs the php-xcache package. Installs the php-xcache package.
Disabled on opensuse need server:php:extensions repo Disabled on opensuse need server:php:extensions repo

View File

@ -82,6 +82,10 @@
'apache2': { 'apache2': {
'ini': '/etc/php5/apache2/php.ini', 'ini': '/etc/php5/apache2/php.ini',
}, },
'xcache': {
'ini': '/etc/php5/mods-available/xcache.ini',
'defaults': {},
},
}, },
'RedHat': { 'RedHat': {
'pkgs': { 'pkgs': {
@ -131,6 +135,9 @@
'cli': { 'cli': {
'ini': '/etc/php.ini', 'ini': '/etc/php.ini',
}, },
'xcache': {
'ini': '/etc/php.d/xcache.ini',
},
}, },
'Suse': { 'Suse': {
'pkgs': { 'pkgs': {
@ -207,6 +214,9 @@
'cli': { 'cli': {
'ini': '/etc/php.ini', 'ini': '/etc/php.ini',
}, },
'xcache': {
'ini': '/etc/php/conf.d/xcache.ini',
},
}, },
}), }),
'fpm': { 'fpm': {
@ -254,6 +264,50 @@
'settings': {}, 'settings': {},
} }
}, },
'xcache': {
'ini': {
'defaults': {
'xcache-common': {
'extension': 'xcache.so',
},
'xcache.admin': {
'xcache.admin.enable_auth': 'On',
},
'xcache': {
'xcache.shm_scheme': '"mmap"',
'xcache.size': '60M',
'xcache.count': '1',
'xcache.slots': '8K',
'xcache.ttl': '0',
'xcache.gc_interval': '0',
'xcache.var_size': '4M',
'xcache.var_count': '1',
'xcache.var_slots': '8K',
'xcache.var_ttl': '0',
'xcache.var_maxttl': '0',
'xcache.var_gc_interval': '300',
'xcache.var_namespace_mode': '0',
'xcache.var_namespace': '""',
'xcache.readonly_protection': 'Off',
'xcache.mmap_path': '"/dev/zero"',
'xcache.coredump_directory': '""',
'xcache.coredump_type': '0',
'xcache.disable_on_crash': 'Off',
'xcache.experimental': 'Off',
'xcache.cacher': 'On',
'xcache.stat': 'On',
'xcache.optimizer': 'Off',
},
'xcache.coverager': {
'xcache.coverager': 'Off',
'xcache.coverager_autostart': 'On',
'xcache.coveragedump_directory': '""',
},
},
'opts': {},
'settings': {},
}
},
'ini': { 'ini': {
'defaults': { 'defaults': {
'PHP': { 'PHP': {

15
php/ng/xcache/ini.sls Normal file
View File

@ -0,0 +1,15 @@
# Manages the php cli main ini file
{% from 'php/ng/map.jinja' import php with context %}
{% from "php/ng/ini.jinja" import php_ini %}
{% set settings = php.xcache.ini.defaults %}
{% for key, value in php.xcache.ini.settings.iteritems() %}
{% if settings[key] is defined %}
{% do settings[key].update(value) %}
{% else %}
{% do settings.update({key: value}) %}
{% endif %}
{% endfor %}
php_xcache_ini:
{{ php_ini(php.lookup.xcache.ini, php.xcache.ini.opts, settings) }}

11
php/ng/xcache/init.sls Normal file
View File

@ -0,0 +1,11 @@
# Installs php-xcache and manages the associated xcache.ini
include:
- php.ng.xcache.install
- php.ng.xcache.ini
extend:
php_xcache_ini:
file:
- require:
- sls: php.ng.xcache.install