Add hhvm support to php ng formulatags/v0.34.0
Manages the php-fpm service. | Manages the php-fpm service. | ||||
``php.ng.hhvm`` | |||||
--------------- | |||||
Meta-state that combines php.ng.hhvm states | |||||
``php.ng.hhvm.config`` | |||||
---------------------- | |||||
Manages the php-hhvm config files | |||||
``php.ng.hhvm.install`` | |||||
----------------------- | |||||
Installs the php-hhvm package | |||||
``php.ng.hhvm.repo`` | |||||
-------------------- | |||||
Configures the hhvm repo for debian/ubuntu | |||||
``php.ng.hhvm.service`` | |||||
----------------------- | |||||
Manages the php-hhvm service. | |||||
``php.ng.gd`` | ``php.ng.gd`` | ||||
------------- | ------------- | ||||
# Manages the php-hhvm main ini file | |||||
{% from "php/ng/map.jinja" import php with context %} | |||||
{% from "php/ng/ini.jinja" import php_ini %} | |||||
{% set server_settings = php.lookup.hhvm.server %} | |||||
{% do server_settings.update(php.hhvm.config.server.settings) %} | |||||
{% set php_settings = php.lookup.hhvm.php %} | |||||
{% do php_settings.update(php.hhvm.config.php.settings) %} | |||||
php_hhvm_ini_config: | |||||
{{ php_ini(php.lookup.hhvm.conf, php.hhvm.config.server.opts, server_settings) }} | |||||
php_hhvm_conf_config: | |||||
{{ php_ini(php.lookup.hhvm.ini, php.hhvm.config.php.opts, php_settings) }} | |||||
# Meta-state to fully install php.hhvm | |||||
include: | |||||
- php.ng.hhvm.repo | |||||
- php.ng.hhvm.config | |||||
- php.ng.hhvm.service | |||||
extend: | |||||
php_hhvm_service: | |||||
service: | |||||
- watch: | |||||
- file: php_hhvm_ini_config | |||||
- file: php_hhvm_conf_config | |||||
- require: | |||||
- sls: php.ng.hhvm.config | |||||
php_hhvm_ini_config: | |||||
file: | |||||
- require: | |||||
- pkg: php_install_hhvm | |||||
php_hhvm_conf_config: | |||||
file: | |||||
- require: | |||||
- pkg: php_install_hhvm |
{% set state = 'hhvm' %} | |||||
{% include "php/ng/installed.jinja" %} |
# Manages the php-hhvm service. | |||||
{% from "php/ng/map.jinja" import php with context %} | |||||
include: | |||||
- php.ng.hhvm.install | |||||
{% if salt['grains.get']('os_family') == 'Debian' -%} | |||||
hhvm_repo: | |||||
pkgrepo.managed: | |||||
- name: deb http://dl.hhvm.com/{{ salt['grains.get']('os')|lower }} {{ salt['grains.get']('oscodename')}} main | |||||
- file: /etc/apt/sources.list.d/hhvm.list | |||||
- keyid: 0x5a16e7281be7a449 | |||||
- keyserver: keyserver.ubuntu.com | |||||
- refresh_db: True | |||||
- require_in: | |||||
- pkg: php_install_hhvm | |||||
{%- endif %} |
# Manages the php-hhvm service. | |||||
{% from "php/ng/map.jinja" import php with context %} | |||||
{% from "php/ng/macro.jinja" import sls_block %} | |||||
{% set service_function = {True:'running', False:'dead'}.get(php.hhvm.service.enabled) %} | |||||
include: | |||||
- php.ng.hhvm.install | |||||
php_hhvm_service: | |||||
service.{{ service_function }}: | |||||
{{ sls_block(php.hhvm.service.opts) }} | |||||
- name: {{ php.lookup.hhvm.service }} | |||||
- enable: {{ php.hhvm.service.enabled }} | |||||
- require: | |||||
- sls: php.ng.hhvm.install | |||||
- watch: | |||||
- pkg: php_install_hhvm | |||||
'apache2': 'libapache2-mod-php5', | 'apache2': 'libapache2-mod-php5', | ||||
'curl': 'php5-curl', | 'curl': 'php5-curl', | ||||
'fpm': 'php5-fpm', | 'fpm': 'php5-fpm', | ||||
'hhvm': 'hhvm', | |||||
'gd': 'php5-gd', | 'gd': 'php5-gd', | ||||
'gmp': 'php5-gmp', | 'gmp': 'php5-gmp', | ||||
'geoip': 'php5-geoip', | 'geoip': 'php5-geoip', | ||||
('include', '/etc/php5/fpm/pool.d/*.conf'), | ('include', '/etc/php5/fpm/pool.d/*.conf'), | ||||
]), | ]), | ||||
}, | }, | ||||
'hhvm': { | |||||
'conf': '/etc/hhvm/server.ini', | |||||
'ini': '/etc/hhvm/php.ini', | |||||
'service': 'hhvm', | |||||
'defaults': {}, | |||||
'server': odict([ | |||||
('pid', '/var/run/hhvm.pid'), | |||||
('hhvm.server.port', '9000'), | |||||
('hhvm.server.type', 'fastcgi'), | |||||
('hhvm.server.default_document', 'index.php'), | |||||
('hhvm.log.use_log_file', 'true'), | |||||
('hhvm.log.file', '/var/log/hhvm/error.log'), | |||||
('hhvm.repo.central.path', '/var/run/hhvm/hhvm.hhbc'), | |||||
]), | |||||
'php': odict([ | |||||
('session.save_handler', 'files'), | |||||
('session.save_path', '/var/lib/hhvm/sessions'), | |||||
('session.gc_maxlifetime', '1440'), | |||||
('hhvm.log.level', 'Warning'), | |||||
('hhvm.log.always_log_unhandled_exceptions', 'true'), | |||||
('hhvm.log.runtime_error_reporting_level', '8191'), | |||||
('hhvm.mysql.typed_results', 'false'), | |||||
]), | |||||
}, | |||||
'cli': { | 'cli': { | ||||
'ini': '/etc/php5/cli/php.ini', | 'ini': '/etc/php5/cli/php.ini', | ||||
}, | }, | ||||
}, | }, | ||||
'pools': {}, | 'pools': {}, | ||||
}, | }, | ||||
'hhvm': { | |||||
'service': { | |||||
'enabled': True, | |||||
'opts': {}, | |||||
}, | |||||
'config': { | |||||
'server': { | |||||
'opts': {}, | |||||
'settings': {}, | |||||
}, | |||||
'php': { | |||||
'opts': {}, | |||||
'settings': {}, | |||||
}, | |||||
}, | |||||
}, | |||||
'cli': { | 'cli': { | ||||
'ini': { | 'ini': { | ||||
'opts': {}, | 'opts': {}, |