427 lines
20 KiB
Django/Jinja
427 lines
20 KiB
Django/Jinja
# -*- coding: utf-8 -*-
|
|
# vim: ft=jinja
|
|
|
|
{%- if salt['grains.get']('os') == "Ubuntu" %}
|
|
{%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %}
|
|
{%- if use_external_repo %}
|
|
{%- set php_version = salt['pillar.get']('php:version', '7.0')|string %}
|
|
{%- if salt['grains.get']('osrelease')|string >= '16.04' %}
|
|
{# Ubuntu 16.04+ specific PHP definitions #}
|
|
{%- set php = salt['grains.filter_by']({
|
|
'Ubuntu': {
|
|
'adodb_pkg': 'libphp-adodb',
|
|
'apc_pkg': 'php-apcu',
|
|
'apcu_pkg': 'php-apcu-bc',
|
|
'bcmath_pkg': 'php' + php_version + '-bcmath',
|
|
'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
|
|
'cgi_pkg': 'php' + php_version + '-cgi',
|
|
'cli_pkg': 'php' + php_version + '-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php' + php_version + '-curl',
|
|
'dev_pkg': 'php' + php_version + '-dev',
|
|
'ext_conf_path': '/etc/php/' + php_version + '/mods-available',
|
|
'fpm_pkg': 'php' + php_version + '-fpm',
|
|
'fpm_service': 'php' + php_version + '-fpm',
|
|
'gd_pkg': 'php' + php_version + '-gd',
|
|
'imagick_pkg': 'php-imagick',
|
|
'imap_pkg': 'php' + php_version + '-imap',
|
|
'intl_pkg': 'php' + php_version + '-intl',
|
|
'json_pkg': 'php' + php_version + '-json',
|
|
'ldap_pkg': 'php' + php_version + '-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-mail',
|
|
'mbstring_pkg': 'php' + php_version + '-mbstring',
|
|
'mcrypt_pkg': 'php' + php_version + '-mcrypt',
|
|
'memcache_pkg': 'php-memcache',
|
|
'memcached_pkg': 'php-memcached',
|
|
'mongo_ext': 'mongodb.so',
|
|
'mongo_pecl': 'mongodb',
|
|
'mysql_pkg': 'php' + php_version + '-mysql',
|
|
'mysqlnd_pkg': 'php' + php_version + '-mysql',
|
|
'oauth_pkg': 'php-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php' + php_version + '-pgsql',
|
|
'php_ini': '/etc/php/' + php_version + '/apache2/php.ini',
|
|
'php_pkg': 'php' + php_version,
|
|
'phpenmod_command': 'phpenmod -v' + php_version,
|
|
'readline_pkg': 'php' + php_version + '-readline',
|
|
'redis_pkg': 'php-redis',
|
|
'soap_pkg': 'php' + php_version + '-soap',
|
|
'sqlite_pkg': 'php' + php_version + '-sqlite3',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'sybase_pkg': 'php' + php_version + '-sybase',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php' + php_version + '-xml',
|
|
'zip_pkg': 'php' + php_version + '-zip',
|
|
}
|
|
}, grain="os", merge=salt['pillar.get']('php:lookup')) %}
|
|
{%- else %}
|
|
{# All other Ubuntu PHP definitions #}
|
|
{%- set php = salt['grains.filter_by']({
|
|
'Ubuntu': {
|
|
'adodb_pkg': 'libphp-adodb',
|
|
'apc_pkg': 'php-apcu',
|
|
'apcu_pkg': 'php-apcu',
|
|
'bcmath_pkg': 'php' + php_version + '-bcmath',
|
|
'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'],
|
|
'cgi_pkg': 'php' + php_version + '-cgi',
|
|
'cli_pkg': 'php' + php_version + '-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php' + php_version + '-curl',
|
|
'dev_pkg': 'php' + php_version + '-dev',
|
|
'ext_conf_path': '/etc/php/' + php_version + '/mods-available',
|
|
'fpm_pkg': 'php' + php_version + '-fpm',
|
|
'fpm_service': 'php' + php_version + '-fpm',
|
|
'gd_pkg': 'php' + php_version + '-gd',
|
|
'imagick_pkg': 'php-imagick',
|
|
'imap_pkg': 'php' + php_version + '-imap',
|
|
'intl_pkg': 'php' + php_version + '-intl',
|
|
'json_pkg': 'php' + php_version + '-json',
|
|
'ldap_pkg': 'php' + php_version + '-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-mail',
|
|
'mbstring_pkg': 'php' + php_version + '-mbstring',
|
|
'mcrypt_pkg': 'php' + php_version + '-mcrypt',
|
|
'memcache_pkg': 'php-memcache',
|
|
'memcached_pkg': 'php-memcached',
|
|
'mongo_ext': 'mongodb.so',
|
|
'mongo_pecl': 'mongodb',
|
|
'mysql_pkg': 'php' + php_version + '-mysql',
|
|
'mysqlnd_pkg': 'php' + php_version + '-mysql',
|
|
'oauth_pkg': 'php-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php' + php_version + '-pgsql',
|
|
'php_ini': '/etc/php/' + php_version + '/apache2/php.ini',
|
|
'php_pkg': 'php' + php_version,
|
|
'phpenmod_command': 'phpenmod -v' + php_version,
|
|
'readline_pkg': 'php' + php_version + '-readline',
|
|
'redis_pkg': 'php-redis',
|
|
'soap_pkg': 'php' + php_version + '-soap',
|
|
'sqlite_pkg': 'php' + php_version + '-sqlite3',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'sybase_pkg': 'php' + php_version + '-sybase',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php' + php_version + '-xml',
|
|
'zip_pkg': 'php' + php_version + '-zip',
|
|
}
|
|
}, grain="os", merge=salt['pillar.get']('php:lookup')) %}
|
|
{%- endif %}
|
|
{%- else %}
|
|
{%- if salt['grains.get']('osrelease')|string >= '17.10' %}
|
|
{# Ubuntu 17.10+ specific PHP definitions #}
|
|
{%- set php = salt['grains.filter_by']({
|
|
'Ubuntu': {
|
|
'adodb_pkg': 'libphp-adodb',
|
|
'apc_pkg': 'php',
|
|
'apcu_pkg': 'php-apcu',
|
|
'bcmath_pkg': 'php-bcmath',
|
|
'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev'],
|
|
'cgi_pkg': 'php-cgi',
|
|
'cli_pkg': 'php-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php-curl',
|
|
'dev_pkg': 'php-dev',
|
|
'ext_conf_path': '/etc/php/7.1/mods-available',
|
|
'fpm_pkg': 'php-fpm',
|
|
'fpm_service': 'php7.1-fpm',
|
|
'gd_pkg': 'php-gd',
|
|
'imagick_pkg': 'php-imagick',
|
|
'imap_pkg': 'php-imap',
|
|
'intl_pkg': 'php-intl',
|
|
'json_pkg': 'php-json',
|
|
'ldap_pkg': 'php-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-mail',
|
|
'mbstring_pkg': 'php-mbstring',
|
|
'mcrypt_pkg': 'php-mcrypt',
|
|
'memcache_pkg': 'php-memcache',
|
|
'memcached_pkg': 'php-memcached',
|
|
'mongo_ext': 'mongodb.so',
|
|
'mongo_pecl': 'php-mongodb',
|
|
'mysql_pkg': 'php-mysql',
|
|
'mysqlnd_pkg': 'php',
|
|
'oauth_pkg': 'php-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php-pgsql',
|
|
'php_ini': '/etc/php/7.1/apache2/php.ini',
|
|
'php_pkg': 'php',
|
|
'phpenmod_command': 'phpenmod',
|
|
'readline_pkg': ' php-readline',
|
|
'redis_pkg': 'php-redis',
|
|
'soap_pkg': 'php-soap',
|
|
'sqlite_pkg': 'php-sqlite3',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'sybase_pkg': 'php-sybase',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php-xml',
|
|
'zip_pkg': 'php-zip',
|
|
}
|
|
}, grain="os", merge=salt['pillar.get']('php:lookup')) %}
|
|
{%- elif salt['grains.get']('osrelease')|string >= '16.04' %}
|
|
{# Ubuntu 16.04+ specific PHP definitions #}
|
|
{%- set php = salt['grains.filter_by']({
|
|
'Ubuntu': {
|
|
'adodb_pkg': 'libphp-adodb',
|
|
'apc_pkg': 'php',
|
|
'apcu_pkg': 'php-apcu',
|
|
'bcmath_pkg': 'php-bcmath',
|
|
'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev'],
|
|
'cgi_pkg': 'php-cgi',
|
|
'cli_pkg': 'php-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php-curl',
|
|
'dev_pkg': 'php-dev',
|
|
'ext_conf_path': '/etc/php/7.0/mods-available',
|
|
'fpm_pkg': 'php-fpm',
|
|
'fpm_service': 'php7.0-fpm',
|
|
'gd_pkg': 'php-gd',
|
|
'imagick_pkg': 'php-imagick',
|
|
'imap_pkg': 'php-imap',
|
|
'intl_pkg': 'php-intl',
|
|
'json_pkg': 'php-json',
|
|
'ldap_pkg': 'php-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-mail',
|
|
'mbstring_pkg': 'php-mbstring',
|
|
'mcrypt_pkg': 'php-mcrypt',
|
|
'memcache_pkg': 'php-memcache',
|
|
'memcached_pkg': 'php-memcached',
|
|
'mongo_ext': 'mongodb.so',
|
|
'mongo_pecl': 'php-mongodb',
|
|
'mysql_pkg': 'php-mysql',
|
|
'mysqlnd_pkg': 'php',
|
|
'oauth_pkg': 'php-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php-pgsql',
|
|
'php_ini': '/etc/php/7.0/apache2/php.ini',
|
|
'php_pkg': 'php',
|
|
'phpenmod_command': 'phpenmod',
|
|
'readline_pkg': ' php-readline',
|
|
'redis_pkg': 'php-redis',
|
|
'soap_pkg': 'php-soap',
|
|
'sqlite_pkg': 'php-sqlite3',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'sybase_pkg': 'php-sybase',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php-xml',
|
|
'zip_pkg': 'php-zip',
|
|
}
|
|
}, grain="os", merge=salt['pillar.get']('php:lookup')) %}
|
|
{%- else %}
|
|
{# All other Ubuntu PHP definitions #}
|
|
{%- set php = salt['grains.filter_by']({
|
|
'Ubuntu': {
|
|
'adodb_pkg': 'php5-adodb',
|
|
'apc_pkg': 'php-apc',
|
|
'apcu_pkg': 'php5-apcu',
|
|
'bcmath_pkg': 'php5',
|
|
'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'],
|
|
'cgi_pkg': 'php5-cgi',
|
|
'cli_pkg': 'php5-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php5-curl',
|
|
'dev_pkg': 'php5-dev',
|
|
'ext_conf_path': salt['grains.filter_by']({
|
|
'precise': '/etc/php5/conf.d',
|
|
'default': '/etc/php5/mods-available',
|
|
}, grain='oscodename'),
|
|
'fpm_pkg': 'php5-fpm',
|
|
'fpm_service': 'php5-fpm',
|
|
'gd_pkg': 'php5-gd',
|
|
'imagick_pkg': 'php5-imagick',
|
|
'imap_pkg': 'php5-imap',
|
|
'intl_pkg': 'php5-intl',
|
|
'json_pkg': 'php5-json',
|
|
'ldap_pkg': 'php5-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-mail',
|
|
'mbstring_pkg': 'php5',
|
|
'mcrypt_pkg': 'php5-mcrypt',
|
|
'memcache_pkg': 'php5-memcache',
|
|
'memcached_pkg': 'php5-memcached',
|
|
'mongo_ext': 'mongo.so',
|
|
'mongo_pecl': 'mongo',
|
|
'mysql_pkg': 'php5-mysql',
|
|
'mysqlnd_pkg': 'php5-mysqlnd',
|
|
'oauth_pkg': 'php5-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php5-pgsql',
|
|
'php_ini': '/etc/php5/apache2/php.ini',
|
|
'php_pkg': 'php5',
|
|
'phpenmod_command': salt['grains.filter_by']({
|
|
'precise': 'true',
|
|
'default': 'php5enmod',
|
|
}, grain='oscodename'),
|
|
'phpenmod_command': 'php5enmod',
|
|
'readline_pkg': ' php5-readline',
|
|
'redis_pkg': 'php5-redis',
|
|
'soap_pkg': 'php-soap',
|
|
'sqlite_pkg': 'php5-sqlite',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'sybase_pkg': 'php5-sybase',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php5',
|
|
'zip_pkg': 'php5',
|
|
},
|
|
}, grain='os', merge=salt['pillar.get']('php:lookup')) %}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
{%- else %}
|
|
{%- set php = salt['grains.filter_by']({
|
|
'Debian': {
|
|
'adodb_pkg': 'php5-adodb',
|
|
'apc_pkg': 'php-apc',
|
|
'apcu_pkg': salt['grains.filter_by']({
|
|
'wheezy': 'php-apc',
|
|
'jessie': 'php5-apcu',
|
|
}, grain='oscodename'),
|
|
'bcmath_pkg': 'php5-fpm',
|
|
'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'build-essential'],
|
|
'cgi_pkg': 'php5-cgi',
|
|
'cli_pkg': 'php5-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php5-curl',
|
|
'dev_pkg': 'php5-dev',
|
|
'ext_conf_path': '/etc/php5/mods-available',
|
|
'fpm_pkg': 'php5-fpm',
|
|
'fpm_service': 'php5-fpm',
|
|
'gd_pkg': 'php5-gd',
|
|
'imagick_pkg': 'php5-imagick',
|
|
'imap_pkg': 'php5-imap',
|
|
'intl_pkg': 'php5-intl',
|
|
'json_pkg': 'php5-json',
|
|
'ldap_pkg': 'php5-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-mail',
|
|
'mbstring_pkg': 'php5',
|
|
'mcrypt_pkg': 'php5-mcrypt',
|
|
'memcache_pkg': 'php5-memcache',
|
|
'memcached_pkg': 'php5-memcached',
|
|
'mongo_ext': 'mongo.so',
|
|
'mongo_pecl': 'mongo',
|
|
'mysql_pkg': 'php5-mysql',
|
|
'mysqlnd_pkg': 'php5-mysqlnd',
|
|
'oauth_pkg': 'php5-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php5-pgsql',
|
|
'php_ini': '/etc/php5/apache2/php.ini',
|
|
'php_pkg': 'php5',
|
|
'phpenmod_command': 'php5enmod',
|
|
'readline_pkg': ' php5-readline',
|
|
'redis_pkg': 'php5-redis',
|
|
'soap_pkg': 'php-soap',
|
|
'sqlite_pkg': 'php5-sqlite',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'sybase_pkg': 'php5-sybase',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php5',
|
|
'zip_pkg': 'php5',
|
|
},
|
|
'RedHat': {
|
|
'adodb_pkg': 'php-adodb',
|
|
'apc_pkg': 'php-pecl-apcu',
|
|
'apcu_pkg': 'php-pecl-apcu',
|
|
'bcmath_pkg': 'php-bcmath',
|
|
'build_pkgs': ['openssl-devel', 'gcc'],
|
|
'cgi_pkg': 'php-cgi',
|
|
'cli_pkg': 'php-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'curl',
|
|
'dev_pkg': 'php-devel',
|
|
'ext_conf_path': '/etc/php.d',
|
|
'fpm_pkg': 'php-fpm',
|
|
'fpm_service': 'php-fpm',
|
|
'gd_pkg': 'php-gd',
|
|
'imagick_pkg': 'php-pecl-imagick',
|
|
'imap_pkg': 'php-imap',
|
|
'intl_pkg': 'php-intl',
|
|
'json_pkg': 'php-common',
|
|
'ldap_pkg': 'php-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mail_pkg': 'php-pear-Mail',
|
|
'mbstring_pkg': 'php-mbstring',
|
|
'mcrypt_pkg': 'php-mcrypt',
|
|
'memcache_pkg': 'php-pecl-memcache',
|
|
'memcached_pkg': 'php-pecl-memcached',
|
|
'mongo_ext': 'mongo.so',
|
|
'mongo_pecl': 'mongo',
|
|
'mysql_pkg': 'php-mysql',
|
|
'mysqlnd_pkg': 'php-mysqlnd',
|
|
'oauth_pkg': 'php-pecl-oauth',
|
|
'pear_pkg': 'php-pear',
|
|
'pgsql_pkg': 'php-pgsql',
|
|
'php_ini': '/etc/php.ini',
|
|
'php_pkg': 'php',
|
|
'readline_pkg': 'php-cli',
|
|
'redis_pkg': 'php-pecl-redis',
|
|
'soap_pkg': 'php-soap',
|
|
'sqlite_pkg': 'php-pdo',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': 'php-xml',
|
|
'zip_pkg': 'php',
|
|
},
|
|
'Suse': {
|
|
'adodb_pkg': 'php5-dba',
|
|
'cli_pkg': 'php5-cli',
|
|
'composer_bin': 'composer',
|
|
'curl_pkg': 'php5-curl',
|
|
'dev_pkg': 'php5-devel',
|
|
'ext_conf_path': '/etc/php5/conf.d',
|
|
'fpm_pkg': 'php5-fpm',
|
|
'fpm_service': 'php5-fpm',
|
|
'gd_pkg': 'php5-gd',
|
|
'imap_pkg': 'php5-imap',
|
|
'intl_pkg': 'php5-intl',
|
|
'json_pkg': 'php5-json',
|
|
'ldap_pkg': 'php5-ldap',
|
|
'local_bin': '/usr/local/bin',
|
|
'mbstring_pkg': 'php5-mbstring',
|
|
'mcrypt_pkg': 'php5-mcrypt',
|
|
'mongo_ext': 'mongo.so',
|
|
'mongo_pecl': 'mongo',
|
|
'mysql_pkg': 'php5-mysql',
|
|
'pear_pkg': 'php5-pear',
|
|
'pgsql_pkg': 'php5-pgsql',
|
|
'php_ini': '/etc/php5/apache2/php.ini',
|
|
'php_pkg': 'php5',
|
|
'readline_pkg': ' php5-readline',
|
|
'soap_pkg': 'php5-soap',
|
|
'sqlite_pkg': 'php5-sqlite',
|
|
'suhosin5_ext': 'suhosin.so',
|
|
'suhosin5_repo': 'https://github.com/sektioneins/suhosin',
|
|
'suhosin7_ext': 'suhosin7.so',
|
|
'suhosin7_repo': 'https://github.com/sektioneins/suhosin7',
|
|
'temp_dir': '/tmp',
|
|
'xml_pkg': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'],
|
|
'zip_pkg': 'php5-zip',
|
|
},
|
|
'FreeBSD': {
|
|
'local_bin': '/usr/local/bin',
|
|
'composer_bin': 'composer',
|
|
'temp_dir': '/tmp',
|
|
},
|
|
}, merge=salt['pillar.get']('php:lookup')) %}
|
|
{%- endif %}
|