Added osfamilymap, osmap and other defaults
This commit is contained in:
parent
9ba0379dac
commit
817c54bbe3
@ -3,6 +3,8 @@
|
|||||||
{%- from tplroot ~ "/map.jinja" import php with context %}
|
{%- from tplroot ~ "/map.jinja" import php with context %}
|
||||||
{%- from tplroot ~ "/ini.jinja" import php_ini %}
|
{%- from tplroot ~ "/ini.jinja" import php_ini %}
|
||||||
|
|
||||||
|
{%- do salt.log.debug('[php.fpm.config] php var is set as: ' ~ php) %}
|
||||||
|
|
||||||
{%- set ini_settings = php.ini.defaults %}
|
{%- set ini_settings = php.ini.defaults %}
|
||||||
{%- for key, value in php.fpm.config.ini.settings.items() %}
|
{%- for key, value in php.fpm.config.ini.settings.items() %}
|
||||||
{%- if ini_settings[key] is defined %}
|
{%- if ini_settings[key] is defined %}
|
||||||
@ -12,7 +14,7 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{%- set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
|
{%- set pillar_php_version = php.pillar_php_version %}
|
||||||
{%- if pillar_php_version is iterable and pillar_php_version is not string %}
|
{%- if pillar_php_version is iterable and pillar_php_version is not string %}
|
||||||
{%- for version in pillar_php_version %}
|
{%- for version in pillar_php_version %}
|
||||||
{%- set conf_settings = odict(php.lookup.fpm.defaults) %}
|
{%- set conf_settings = odict(php.lookup.fpm.defaults) %}
|
||||||
|
@ -5,8 +5,6 @@ include:
|
|||||||
- php.fpm.service
|
- php.fpm.service
|
||||||
- php.fpm.pools
|
- php.fpm.pools
|
||||||
|
|
||||||
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
|
|
||||||
|
|
||||||
extend:
|
extend:
|
||||||
{% if pillar_php_version is iterable and pillar_php_version is not string %}
|
{% if pillar_php_version is iterable and pillar_php_version is not string %}
|
||||||
{% for version in pillar_php_version %}
|
{% for version in pillar_php_version %}
|
||||||
|
@ -1,11 +1,57 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# vim: ft=jinja
|
# vim: ft=jinja
|
||||||
|
{%- set tplroot = tpldir.split('/')[0] %}
|
||||||
|
{#- Start imports as #}
|
||||||
|
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
|
||||||
|
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %}
|
||||||
|
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
|
||||||
|
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
|
||||||
|
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
|
||||||
|
|
||||||
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
|
{#- Retrieve the config dict only once #}
|
||||||
{%- if pillar_php_version is iterable and pillar_php_version is not string %}
|
{%- set _config = salt['config.get'](tplroot, default={}) %}
|
||||||
{%- set php_version = pillar_php_version[0]|string %}
|
|
||||||
|
{%- set defaults = salt['grains.filter_by'](
|
||||||
|
default_settings,
|
||||||
|
default=tplroot,
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
|
osarchmap,
|
||||||
|
grain='osarch',
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
|
osfamilymap,
|
||||||
|
grain='os_family',
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
|
osmap,
|
||||||
|
grain='os',
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
|
osfingermap,
|
||||||
|
grain='osfinger',
|
||||||
|
merge=salt['grains.filter_by'](
|
||||||
|
_config,
|
||||||
|
default='php'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
%}
|
||||||
|
|
||||||
|
{%- set config = salt['grains.filter_by'](
|
||||||
|
{'defaults': defaults},
|
||||||
|
default='defaults',
|
||||||
|
merge=_config
|
||||||
|
)
|
||||||
|
%}
|
||||||
|
|
||||||
|
{% set php = config %}
|
||||||
|
|
||||||
|
{%- do salt.log.debug('[map.jinja] php var is set as: ' ~ php) %}
|
||||||
|
|
||||||
|
{%- if php['pillar_php_version'] is iterable and php['pillar_php_version'] is not string %}
|
||||||
|
{%- set php_version = php['pillar_php_version'][0]|string %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{%- set php_version = pillar_php_version|string %}
|
{%- set php_version = php['pillar_php_version']|string %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{%- set freebsd_php_version = php_version.replace('.', '') %}
|
{%- set freebsd_php_version = php_version.replace('.', '') %}
|
||||||
|
|
||||||
@ -722,7 +768,7 @@
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
{%- if salt['grains.get']('osrelease')|string >= '18.04' %}
|
{%- if salt['grains.get']('osrelease')|string >= '18.04' %}
|
||||||
{%- set php = salt['pillar.get']('php', {
|
{%- merge = php, salt['pillar.get']('php', {
|
||||||
'lookup': salt['grains.filter_by']({
|
'lookup': salt['grains.filter_by']({
|
||||||
'Ubuntu': {
|
'Ubuntu': {
|
||||||
'pkgs': {
|
'pkgs': {
|
||||||
@ -730,16 +776,16 @@
|
|||||||
'apache2': 'libapache2-mod-php',
|
'apache2': 'libapache2-mod-php',
|
||||||
'apc': 'php',
|
'apc': 'php',
|
||||||
'apcu': 'php-apcu',
|
'apcu': 'php-apcu',
|
||||||
'bcmath': 'php7.2-bcmath',
|
'bcmath': 'php' + php_version + '-bcmath',
|
||||||
'bz2': 'php7.2-bz2',
|
'bz2': 'php' + php_version + '-bz2',
|
||||||
'cache-lite': 'php-cache-lite',
|
'cache-lite': 'php-cache-lite',
|
||||||
'cgi': 'php-cgi',
|
'cgi': 'php-cgi',
|
||||||
'cli': 'php-cli',
|
'cli': 'php-cli',
|
||||||
'console-table': 'php-console-table',
|
'console-table': 'php-console-table',
|
||||||
'composer_bin': 'composer',
|
'composer_bin': 'composer',
|
||||||
'curl': 'php-curl',
|
'curl': 'php-curl',
|
||||||
'dev': 'php7.2-dev',
|
'dev': 'php' + php_version + '-dev',
|
||||||
'dba': 'php7.2-dba',
|
'dba': 'php' + php_version + '-dba',
|
||||||
'fpm': 'php-fpm',
|
'fpm': 'php-fpm',
|
||||||
'gd': 'php-gd',
|
'gd': 'php-gd',
|
||||||
'geoip': 'php-geoip',
|
'geoip': 'php-geoip',
|
||||||
@ -766,7 +812,7 @@
|
|||||||
'net6': 'php-net-ipv6',
|
'net6': 'php-net-ipv6',
|
||||||
'oauth': 'php-oauth',
|
'oauth': 'php-oauth',
|
||||||
'odbc': 'php-odbc',
|
'odbc': 'php-odbc',
|
||||||
'opcache': 'php7.2-opcache',
|
'opcache': 'php' + php_version + '-opcache',
|
||||||
'pear': 'php-pear',
|
'pear': 'php-pear',
|
||||||
'pgsql': 'php-pgsql',
|
'pgsql': 'php-pgsql',
|
||||||
'php': 'php',
|
'php': 'php',
|
||||||
@ -782,26 +828,26 @@
|
|||||||
'sybase': 'php-sybase',
|
'sybase': 'php-sybase',
|
||||||
'tcpdf': 'php-tcpdf',
|
'tcpdf': 'php-tcpdf',
|
||||||
'temp_dir': '/tmp',
|
'temp_dir': '/tmp',
|
||||||
'tidy': 'php7.2-tidy',
|
'tidy': 'php' + php_version + '-tidy',
|
||||||
'xcache': 'php',
|
'xcache': 'php',
|
||||||
'xdebug': 'php-xdebug',
|
'xdebug': 'php-xdebug',
|
||||||
'xml': ['php-xml', 'php-xmlrpc'],
|
'xml': ['php-xml', 'php-xmlrpc'],
|
||||||
'xsl': 'php7.2-xsl',
|
'xsl': 'php' + php_version + '-xsl',
|
||||||
'zip': 'php-zip',
|
'zip': 'php-zip',
|
||||||
},
|
},
|
||||||
'fpm': {
|
'fpm': {
|
||||||
'conf': '/etc/php/7.2/fpm/php-fpm.conf',
|
'conf': '/etc/php/' + php_version + '/fpm/php-fpm.conf',
|
||||||
'ini': '/etc/php/7.2/fpm/php.ini',
|
'ini': '/etc/php/' + php_version + '/fpm/php.ini',
|
||||||
'pools': '/etc/php/7.2/fpm/pool.d',
|
'pools': '/etc/php/' + php_version + '/fpm/pool.d',
|
||||||
'service': 'php7.2-fpm',
|
'service': 'php' + php_version + '-fpm',
|
||||||
'user': 'root',
|
'user': 'root',
|
||||||
'group': 'root',
|
'group': 'root',
|
||||||
'defaults': odict([
|
'defaults': odict([
|
||||||
('global', odict([
|
('global', odict([
|
||||||
('pid', '/var/run/php7.2-fpm.pid'),
|
('pid', '/var/run/php' + php_version + '-fpm.pid'),
|
||||||
('error_log', '/var/log/php7.2-fpm.log'),
|
('error_log', '/var/log/php' + php_version + '-fpm.log'),
|
||||||
])),
|
])),
|
||||||
('include', '/etc/php/7.2/fpm/pool.d/*.conf'),
|
('include', '/etc/php/' + php_version + '/fpm/pool.d/*.conf'),
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
'hhvm': {
|
'hhvm': {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user