From 7fbb40b007464c62581dbc4d2a933016be3406a3 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 7 Aug 2019 11:56:08 +0100 Subject: [PATCH] feat(ng): promote NG formula --- docs/README.rst | 411 +- php/adodb.sls | 12 +- php/{ng => }/apache2/files/mod_php.conf.jinja | 7 +- php/{ng => }/apache2/ini.sls | 8 +- php/apache2/init.sls | 13 + php/apache2/install.sls | 19 + php/apc.sls | 12 +- php/apcu.sls | 12 +- php/auth-sasl.sls | 3 + php/bcmath.sls | 12 +- php/bz2.sls | 3 + php/cache-lite.sls | 3 + php/cgi.sls | 12 +- php/cli.sls | 9 - php/cli/ini.sls | 27 + php/cli/init.sls | 22 + php/cli/install.sls | 29 + php/composer.sls | 32 +- php/console-table.sls | 3 + php/ctype.sls | 3 + php/curl.sls | 12 +- php/dba.sls | 3 + php/dev.sls | 12 +- php/dom.sls | 3 + php/fileinfo.sls | 3 + php/{ng => }/files/php.ini | 0 php/filter.sls | 3 + php/fpm.sls | 11 - php/fpm/config.sls | 64 + php/fpm/init.sls | 44 + php/fpm/install.sls | 3 + php/{ng => }/fpm/pools.sls | 12 +- php/fpm/pools_config.sls | 46 + php/{ng => }/fpm/service.sls | 10 +- php/gd.sls | 12 +- php/gearman.sls | 3 + php/geoip.sls | 3 + php/geshi.sls | 3 + php/gettext.sls | 3 + php/gmp.sls | 3 + php/hash.sls | 3 + php/hhvm/config.sls | 17 + php/{ng => }/hhvm/init.sls | 9 +- php/hhvm/install.sls | 3 + php/{ng => }/hhvm/repo.sls | 8 +- php/hhvm/service.sls | 20 + php/http.sls | 3 + php/iconv.sls | 3 + php/igbinary.sls | 3 + php/imagick.sls | 12 +- php/imap.sls | 12 +- php/ini.jinja | 15 + php/init.sls | 36 +- php/installed.jinja | 120 + php/intl.sls | 12 +- php/json.sls | 12 +- php/ldap.sls | 12 +- php/{ng => }/macro.jinja | 10 +- php/mail.sls | 12 +- php/map.jinja | 3673 ++++++++++++++--- php/mbstring.sls | 12 +- php/mcrypt.sls | 12 +- php/mdb2/init.sls | 3 + php/mdb2/mysql.sls | 4 + php/mdb2/pgsql.sls | 4 + php/memcache.sls | 12 +- php/memcached.sls | 12 +- php/modules.sls | 24 + php/mongo.sls | 46 +- php/mongodb.sls | 3 + php/msgpack.sls | 3 + php/mysql.sls | 12 +- php/mysqlnd.sls | 12 +- php/net-smtp.sls | 3 + php/net4.sls | 3 + php/net6.sls | 10 + php/ng/adodb.sls | 2 - php/ng/apache2/init.sls | 14 - php/ng/apache2/install.sls | 21 - php/ng/apc.sls | 2 - php/ng/apcu.sls | 2 - php/ng/auth-sasl.sls | 2 - php/ng/bcmath.sls | 2 - php/ng/bz2.sls | 2 - php/ng/cache-lite.sls | 2 - php/ng/cgi.sls | 2 - php/ng/composer.sls | 62 - php/ng/console-table.sls | 2 - php/ng/ctype.sls | 2 - php/ng/curl.sls | 2 - php/ng/dba.sls | 2 - php/ng/dev.sls | 2 - php/ng/dom.sls | 2 - php/ng/fileinfo.sls | 2 - php/ng/filter.sls | 2 - php/ng/fpm/install.sls | 5 - php/ng/gd.sls | 2 - php/ng/gearman.sls | 2 - php/ng/geoip.sls | 2 - php/ng/geshi.sls | 2 - php/ng/gettext.sls | 2 - php/ng/gmp.sls | 2 - php/ng/hash.sls | 2 - php/ng/hhvm/config.sls | 19 - php/ng/hhvm/install.sls | 5 - php/ng/hhvm/service.sls | 20 - php/ng/http.sls | 2 - php/ng/iconv.sls | 2 - php/ng/igbinary.sls | 2 - php/ng/imagick.sls | 2 - php/ng/imap.sls | 2 - php/ng/init.sls | 2 - php/ng/intl.sls | 2 - php/ng/json.sls | 2 - php/ng/ldap.sls | 2 - php/ng/mail.sls | 2 - php/ng/mbstring.sls | 2 - php/ng/mcrypt.sls | 2 - php/ng/mdb2/init.sls | 5 - php/ng/mdb2/mysql.sls | 6 - php/ng/mdb2/pgsql.sls | 6 - php/ng/memcache.sls | 2 - php/ng/memcached.sls | 2 - php/ng/modules.sls | 23 - php/ng/mongo.sls | 2 - php/ng/mongodb.sls | 2 - php/ng/msgpack.sls | 2 - php/ng/mysql.sls | 2 - php/ng/mysqlnd.sls | 2 - php/ng/net-smtp.sls | 2 - php/ng/net4.sls | 2 - php/ng/net6.sls | 9 - php/ng/oauth.sls | 2 - php/ng/opcache.sls | 2 - php/ng/openssl.sls | 2 - php/ng/pdo.sls | 2 - php/ng/pdo_mysql.sls | 2 - php/ng/pear.sls | 2 - php/ng/pgsql.sls | 2 - php/ng/phar.sls | 2 - php/ng/posix.sls | 2 - php/ng/pspell.sls | 2 - php/ng/readline.sls | 2 - php/ng/redis.sls | 2 - php/ng/seclib.sls | 2 - php/ng/session.sls | 2 - php/ng/simplexml.sls | 2 - php/ng/snmp.sls | 2 - php/ng/soap.sls | 2 - php/ng/sqlite.sls | 2 - php/ng/ssh2.sls | 2 - php/ng/suhosin.sls | 90 - php/ng/svn.sls | 2 - php/ng/sybase.sls | 2 - php/ng/tcpdf.sls | 2 - php/ng/tidy.sls | 2 - php/ng/tokenizer.sls | 2 - php/ng/uuid.sls | 2 - php/ng/xcache/ini.sls | 18 - php/ng/xcache/install.sls | 5 - php/ng/xdebug.sls | 2 - php/ng/xml.sls | 2 - php/ng/xmlwriter.sls | 2 - php/ng/xsl.sls | 2 - php/ng/zip.sls | 2 - php/oauth.sls | 12 +- php/opcache.sls | 3 + php/openssl.sls | 3 + php/pdo.sls | 3 + php/pdo_mysql.sls | 3 + php/pear.sls | 12 +- php/pgsql.sls | 12 +- php/phar.sls | 3 + php/posix.sls | 3 + php/pspell.sls | 3 + php/readline.sls | 13 +- php/redis.sls | 12 +- php/seclib.sls | 3 + php/session.sls | 3 + php/simplexml.sls | 3 + php/snmp.sls | 3 + php/soap.sls | 12 +- php/sqlite.sls | 12 +- php/ssh2.sls | 3 + php/suhosin.sls | 38 +- php/svn.sls | 3 + php/sybase.sls | 12 +- php/tcpdf.sls | 3 + php/tidy.sls | 3 + php/tokenizer.sls | 3 + php/uuid.sls | 3 + php/xcache/ini.sls | 16 + php/{ng => }/xcache/init.sls | 7 +- php/xcache/install.sls | 3 + php/xdebug.sls | 3 + php/xml.sls | 12 +- php/xmlwriter.sls | 3 + php/xsl.sls | 3 + php/zip.sls | 12 +- pillar.example | 350 +- 200 files changed, 4287 insertions(+), 1839 deletions(-) rename php/{ng => }/apache2/files/mod_php.conf.jinja (58%) rename php/{ng => }/apache2/ini.sls (58%) create mode 100644 php/apache2/init.sls create mode 100644 php/apache2/install.sls create mode 100644 php/auth-sasl.sls create mode 100644 php/bz2.sls create mode 100644 php/cache-lite.sls delete mode 100644 php/cli.sls create mode 100644 php/cli/ini.sls create mode 100644 php/cli/init.sls create mode 100644 php/cli/install.sls create mode 100644 php/console-table.sls create mode 100644 php/ctype.sls create mode 100644 php/dba.sls create mode 100644 php/dom.sls create mode 100644 php/fileinfo.sls rename php/{ng => }/files/php.ini (100%) create mode 100644 php/filter.sls delete mode 100644 php/fpm.sls create mode 100644 php/fpm/config.sls create mode 100644 php/fpm/init.sls create mode 100644 php/fpm/install.sls rename php/{ng => }/fpm/pools.sls (56%) create mode 100644 php/fpm/pools_config.sls rename php/{ng => }/fpm/service.sls (64%) create mode 100644 php/gearman.sls create mode 100644 php/geoip.sls create mode 100644 php/geshi.sls create mode 100644 php/gettext.sls create mode 100644 php/gmp.sls create mode 100644 php/hash.sls create mode 100644 php/hhvm/config.sls rename php/{ng => }/hhvm/init.sls (74%) create mode 100644 php/hhvm/install.sls rename php/{ng => }/hhvm/repo.sls (68%) create mode 100644 php/hhvm/service.sls create mode 100644 php/http.sls create mode 100644 php/iconv.sls create mode 100644 php/igbinary.sls create mode 100644 php/ini.jinja create mode 100644 php/installed.jinja rename php/{ng => }/macro.jinja (79%) create mode 100644 php/mdb2/init.sls create mode 100644 php/mdb2/mysql.sls create mode 100644 php/mdb2/pgsql.sls create mode 100644 php/modules.sls create mode 100644 php/mongodb.sls create mode 100644 php/msgpack.sls create mode 100644 php/net-smtp.sls create mode 100644 php/net4.sls create mode 100644 php/net6.sls delete mode 100644 php/ng/adodb.sls delete mode 100644 php/ng/apache2/init.sls delete mode 100644 php/ng/apache2/install.sls delete mode 100644 php/ng/apc.sls delete mode 100644 php/ng/apcu.sls delete mode 100644 php/ng/auth-sasl.sls delete mode 100644 php/ng/bcmath.sls delete mode 100644 php/ng/bz2.sls delete mode 100644 php/ng/cache-lite.sls delete mode 100644 php/ng/cgi.sls delete mode 100644 php/ng/composer.sls delete mode 100644 php/ng/console-table.sls delete mode 100644 php/ng/ctype.sls delete mode 100644 php/ng/curl.sls delete mode 100644 php/ng/dba.sls delete mode 100644 php/ng/dev.sls delete mode 100644 php/ng/dom.sls delete mode 100644 php/ng/fileinfo.sls delete mode 100644 php/ng/filter.sls delete mode 100644 php/ng/fpm/install.sls delete mode 100644 php/ng/gd.sls delete mode 100644 php/ng/gearman.sls delete mode 100644 php/ng/geoip.sls delete mode 100644 php/ng/geshi.sls delete mode 100644 php/ng/gettext.sls delete mode 100644 php/ng/gmp.sls delete mode 100644 php/ng/hash.sls delete mode 100644 php/ng/hhvm/config.sls delete mode 100644 php/ng/hhvm/install.sls delete mode 100644 php/ng/hhvm/service.sls delete mode 100644 php/ng/http.sls delete mode 100644 php/ng/iconv.sls delete mode 100644 php/ng/igbinary.sls delete mode 100644 php/ng/imagick.sls delete mode 100644 php/ng/imap.sls delete mode 100644 php/ng/init.sls delete mode 100644 php/ng/intl.sls delete mode 100644 php/ng/json.sls delete mode 100644 php/ng/ldap.sls delete mode 100644 php/ng/mail.sls delete mode 100644 php/ng/mbstring.sls delete mode 100644 php/ng/mcrypt.sls delete mode 100644 php/ng/mdb2/init.sls delete mode 100644 php/ng/mdb2/mysql.sls delete mode 100644 php/ng/mdb2/pgsql.sls delete mode 100644 php/ng/memcache.sls delete mode 100644 php/ng/memcached.sls delete mode 100644 php/ng/modules.sls delete mode 100644 php/ng/mongo.sls delete mode 100644 php/ng/mongodb.sls delete mode 100644 php/ng/msgpack.sls delete mode 100644 php/ng/mysql.sls delete mode 100644 php/ng/mysqlnd.sls delete mode 100644 php/ng/net-smtp.sls delete mode 100644 php/ng/net4.sls delete mode 100644 php/ng/net6.sls delete mode 100644 php/ng/oauth.sls delete mode 100644 php/ng/opcache.sls delete mode 100644 php/ng/openssl.sls delete mode 100644 php/ng/pdo.sls delete mode 100644 php/ng/pdo_mysql.sls delete mode 100644 php/ng/pear.sls delete mode 100644 php/ng/pgsql.sls delete mode 100644 php/ng/phar.sls delete mode 100644 php/ng/posix.sls delete mode 100644 php/ng/pspell.sls delete mode 100644 php/ng/readline.sls delete mode 100644 php/ng/redis.sls delete mode 100644 php/ng/seclib.sls delete mode 100644 php/ng/session.sls delete mode 100644 php/ng/simplexml.sls delete mode 100644 php/ng/snmp.sls delete mode 100644 php/ng/soap.sls delete mode 100644 php/ng/sqlite.sls delete mode 100644 php/ng/ssh2.sls delete mode 100644 php/ng/suhosin.sls delete mode 100644 php/ng/svn.sls delete mode 100644 php/ng/sybase.sls delete mode 100644 php/ng/tcpdf.sls delete mode 100644 php/ng/tidy.sls delete mode 100644 php/ng/tokenizer.sls delete mode 100644 php/ng/uuid.sls delete mode 100644 php/ng/xcache/ini.sls delete mode 100644 php/ng/xcache/install.sls delete mode 100644 php/ng/xdebug.sls delete mode 100644 php/ng/xml.sls delete mode 100644 php/ng/xmlwriter.sls delete mode 100644 php/ng/xsl.sls delete mode 100644 php/ng/zip.sls create mode 100644 php/opcache.sls create mode 100644 php/openssl.sls create mode 100644 php/pdo.sls create mode 100644 php/pdo_mysql.sls create mode 100644 php/phar.sls create mode 100644 php/posix.sls create mode 100644 php/pspell.sls create mode 100644 php/seclib.sls create mode 100644 php/session.sls create mode 100644 php/simplexml.sls create mode 100644 php/snmp.sls create mode 100644 php/ssh2.sls create mode 100644 php/svn.sls create mode 100644 php/tcpdf.sls create mode 100644 php/tidy.sls create mode 100644 php/tokenizer.sls create mode 100644 php/uuid.sls create mode 100644 php/xcache/ini.sls rename php/{ng => }/xcache/init.sls (53%) create mode 100644 php/xcache/install.sls create mode 100644 php/xdebug.sls create mode 100644 php/xmlwriter.sls create mode 100644 php/xsl.sls diff --git a/docs/README.rst b/docs/README.rst index b57c7076..606cc7e7 100644 --- a/docs/README.rst +++ b/docs/README.rst @@ -70,694 +70,489 @@ Available states .. contents:: :local: -``php`` -^^^^^^^ - -Installs the php package. - -``php.adodb`` -^^^^^^^^^^^^^ - -Installs the php-adodb package. - -``php.apc`` -^^^^^^^^^^^ - -Installs the php-apc package. -Disabled by default on opensuse need server:php repo - -``php.apcu`` -^^^^^^^^^^^^ - -Installs the php-apcu package. -Disabled by default on opensuse need server:php repo - -``php.bcmath`` -^^^^^^^^^^^^^^ - -Installs the php-bcmath package. - -``php.cgi`` -^^^^^^^^^^^ - -Installs the php-cgi package. -Disabled on opensuse not available, only fastcgi - -``php.cli`` -^^^^^^^^^^^ - -Installs the php-cli package. - -``php.composer`` -^^^^^^^^^^^^^^^^ - -Installs [composer](https://getcomposer.org) and keeps it updated. - -``php.curl`` -^^^^^^^^^^^^ - -Installs the php5-curl package on Debian, and ensures that curl itself is -installed for RedHat systems, this is due to the curl libs being provided by -php-common, which will get installed with the main php package. - -``php.dev`` -^^^^^^^^^^^ - -Installs the php-dev package. - -``php.fileinfo`` -^^^^^^^^^^^^^^^^ - -Installs the php-fileinfo package and enables it. - -``php.fpm`` -^^^^^^^^^^^ - -Installs the php-fpm package, starts the service, and enables it. - -``php.gd`` -^^^^^^^^^^ - -Installs the php-gd package. - -``php.imagick`` -^^^^^^^^^^^^^^^ - -Installs the php-imagick package. -Disabled on opensuse not available. - -``php.imap`` -^^^^^^^^^^^^ - -Installs the php-imap package. - -``php.intl`` -^^^^^^^^^^^^ - -Installs the php-intl package. - -``php.json`` -^^^^^^^^^^^^ - -Installs the php-json package. - -``php.ldap`` -^^^^^^^^^^^^ - -Installs the php-ldap package. - -``php.mail`` -^^^^^^^^^^^^ - -Installs the php-mail package. - -``php.mbstring`` -^^^^^^^^^^^^^^^^ - -Installs the php-mbstring package. - -``php.mcrypt`` -^^^^^^^^^^^^^^ - -Installs the php-mcrypt package. - -``php.memcache`` -^^^^^^^^^^^^^^^^ - -Installs the php-memcache package. -Disabled on opensuse need server:php:extensions repo - -``php.memcached`` -^^^^^^^^^^^^^^^^^ - -Installs the php-memcached package. -Disabled on opensuse need server:php:extensions repo - -``php.mongo`` -^^^^^^^^^^^^^ - -Installs the php-mongo package. -Disabled on opensuse need server:php:extensions repo - -``php.mysql`` -^^^^^^^^^^^^^ - -Installs the php-mysql package. - -``php.mysqlnd`` -^^^^^^^^^^^^^^^ - -Installs the php-mysqlnd package. -Disabled on opensuse no package. - -``php.oauth`` -^^^^^^^^^^^^^ - -Installs the php-oauth package. - -``php.pear`` -^^^^^^^^^^^^ - -Installs the php-pear package. - -``php.pgsql`` -^^^^^^^^^^^^^ - -Installs the php-pgsql package. - -``php.readline`` -^^^^^^^^^^^^^^^^ - -Installs the php-readline package. - -``php.redis`` -^^^^^^^^^^^^^ - -Installs the php-redis package. -Disabled on opensuse need server:php:extensions repo - -``php.soap`` -^^^^^^^^^^^^ - -Installs the php-soap package. - -``php.sqlite`` -^^^^^^^^^^^^^^ - -Installs the php-sqlite package, - -``php.suhosin`` -^^^^^^^^^^^^^^^ - -Installs the php-suhosin package. - -``php.sybase`` -^^^^^^^^^^^^^^ - -Installs the php-sybase package for Sybase/MS-SQL. Debian / Ubuntu as RedHat has no similar package. - -``php.tokenizer`` -^^^^^^^^^^^^^^^^^ - -Installs the php-tokenizer package and enables it. - -``php.xml`` -^^^^^^^^^^^ - -Installs the php-xml package. - -``php.zip`` -^^^^^^^^^^^ - -Installs the php-zip package. - -Next-generation, alternate approach ------------------------------------ - -The following states provide an alternate approach to managing PHP and FPM -pools, as well as code organization. Please provide feedback by filing issues, +Please provide feedback by filing issues, discussing in ``#salt`` in Freenode and the mailing list as normal. -**Note:** php.ng states require the merge parameter of salt.modules.pillar.get(), +**Note:** php states require the merge parameter of salt.modules.pillar.get(), first available in the Helium release. .. contents:: :local: -``php.ng`` +``php`` ^^^^^^^^^^ Installs the php package. -``php.ng.adodb`` +``php.adodb`` ^^^^^^^^^^^^^^^^ Installs the php-adodb package. -``php.ng.apache2`` +``php.apache2`` ^^^^^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.apache2.install`_ and `php.ng.apache2.ini`_. +Meta-state that combines `php.apache2.install`_ and `php.apache2.ini`_. -``php.ng.apache2.ini`` +``php.apache2.ini`` ^^^^^^^^^^^^^^^^^^^^^^ Manages the apache2 php.ini file -``php.ng.apache2.install`` +``php.apache2.install`` ^^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the apache2 and libapache2-mod-php5 package. Debian Only. -``php.ng.apc`` +``php.apc`` ^^^^^^^^^^^^^^ Installs the php-apc package. Disabled on opensuse need server:php repo -``php.ng.apcu`` +``php.apcu`` ^^^^^^^^^^^^^^^ Installs the php-apcu package. Disabled on opensuse need server:php repo -``php.ng.auth-sasl`` +``php.auth-sasl`` ^^^^^^^^^^^^^^^^^^^^ Installs the php-auth-sasl package. -``php.ng.bcmath`` +``php.bcmath`` ^^^^^^^^^^^^^^^^^ Installs the php-bcmath package. -``php.ng.bz2`` +``php.bz2`` ^^^^^^^^^^^^^^ Installs the php-bz2 package. -``php.ng.cache-lite`` +``php.cache-lite`` ^^^^^^^^^^^^^^^^^^^^^ Installs the php-cache-lite package. -``php.ng.cgi`` +``php.cgi`` ^^^^^^^^^^^^^^ Installs the php-cgi package. Disabled on opensuse only php5-fastcgi available. -``php.ng.cli`` +``php.cli`` ^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.cli.install`_ and `php.ng.cli.ini`_. +Meta-state that combines `php.cli.install`_ and `php.cli.ini`_. -``php.ng.cli.ini`` +``php.cli.ini`` ^^^^^^^^^^^^^^^^^^ Manages the php-cli ini file. -``php.ng.cli.install`` +``php.cli.install`` ^^^^^^^^^^^^^^^^^^^^^^ Installs the php-cli package. -``php.ng.composer`` +``php.composer`` ^^^^^^^^^^^^^^^^^^^ Installs [composer](https://getcomposer.org) and keeps it updated. -``php.ng.console-table`` +``php.console-table`` ^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-console-table package. -``php.ng.ctype`` +``php.ctype`` ^^^^^^^^^^^^^^^^ Installs the php-ctype package. -``php.ng.curl`` +``php.curl`` ^^^^^^^^^^^^^^^ Installs the php5-curl package on Debian, and ensures that curl itself is installed for RedHat systems, this is due to the curl libs being provided by php-common, which will get installed with the main php package. -``php.ng.dba`` +``php.dba`` ^^^^^^^^^^^^^^ Installs the php-dba package. -``php.ng.dev`` +``php.dev`` ^^^^^^^^^^^^^^ Installs the php5-dev and build-essential package. -``php.ng.filter`` +``php.filter`` ^^^^^^^^^^^^^^^^^ Installs the php-filter package. -``php.ng.fpm`` +``php.fpm`` ^^^^^^^^^^^^^^ -Meta-state that combines all php.ng.fpm states. +Meta-state that combines all php.fpm states. -``php.ng.fpm.config`` +``php.fpm.config`` ^^^^^^^^^^^^^^^^^^^^^ Manages the (non-pool) php-fpm config files. -``php.ng.fpm.install`` +``php.fpm.install`` ^^^^^^^^^^^^^^^^^^^^^^ Installs the php-fpm package. -``php.ng.fpm.pools`` +``php.fpm.pools`` ^^^^^^^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.fpm.service`_ and `php.ng.fpm.pools_config`_ +Meta-state that combines `php.fpm.service`_ and `php.fpm.pools_config`_ -``php.ng.fpm.pools_config`` +``php.fpm.pools_config`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Manages php-fpm pool config files. -``php.ng.fpm.service`` +``php.fpm.service`` ^^^^^^^^^^^^^^^^^^^^^^ Manages the php-fpm service. -``php.ng.gd`` +``php.gd`` ^^^^^^^^^^^^^ Installs the php-gd package. -``php.ng.gearman`` +``php.gearman`` ^^^^^^^^^^^^^^^^^^ Installs the php-gearman package. -``php.ng.geoip`` +``php.geoip`` ^^^^^^^^^^^^^^^^ Installs the php-geoip package. -``php.ng.geshi`` +``php.geshi`` ^^^^^^^^^^^^^^^^ Installs the php-geshi package. -``php.ng.gettext`` +``php.gettext`` ^^^^^^^^^^^^^^^^^^ Installs the php-gettext package. -``php.ng.gmp`` +``php.gmp`` ^^^^^^^^^^^^^^ Installs the php-gmp package. Debian Only. -``php.ng.hash`` +``php.hash`` ^^^^^^^^^^^^^^^ Installs the php-hash package. -``php.ng.http`` +``php.http`` ^^^^^^^^^^^^^^^ Installs the php-http package. -``php.ng.hhvm`` +``php.hhvm`` ^^^^^^^^^^^^^^^ -Meta-state that combines php.ng.hhvm states +Meta-state that combines php.hhvm states -``php.ng.hhvm.config`` +``php.hhvm.config`` ^^^^^^^^^^^^^^^^^^^^^^ Manages the php-hhvm config files -``php.ng.hhvm.install`` +``php.hhvm.install`` ^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-hhvm package -``php.ng.hhvm.repo`` +``php.hhvm.repo`` ^^^^^^^^^.REPO^^^^^^ Configures the hhvm repo for debian/ubuntu -``php.ng.hhvm.service`` +``php.hhvm.service`` ^^^^^^^^^^^^^^^^^^^^^^^ Manages the php-hhvm service. -``php.ng.igbinary`` +``php.igbinary`` ^^^^^^^^^^^^^^^^^^^ Installs the php-igbinary package. -``php.ng.imagick`` +``php.imagick`` ^^^^^^^^^^^^^^^^^^ Installs the php-imagick package. Disabled on opensuse no package. -``php.ng.imap`` +``php.imap`` ^^^^^^^^^^^^^^^ Installs the php-imap package. -``php.ng.intl`` +``php.intl`` ^^^^^^^^^^^^^^^ Installs the php-intl package. -``php.ng.json`` +``php.json`` ^^^^^^^^^^^^^^^ Installs the php-json package. -``php.ng.ldap`` +``php.ldap`` ^^^^^^^^^^^^^^^ Installs the php-ldap package. -``php.ng.mail`` +``php.mail`` ^^^^^^^^^^^^^^^ Installs the php-mail package. -``php.ng.mbstring`` +``php.mbstring`` ^^^^^^^^^^^^^^^^^^^ Installs the php-mbstring package. -``php.ng.mcrypt`` +``php.mcrypt`` ^^^^^^^^^^^^^^^^^ Installs the php-mcrypt package. -``php.ng.mdb2`` +``php.mdb2`` ^^^^^^^^^^^^^^^ Installs the php-mdb2 package. -``php.ng.mdb2-driver-mysql`` +``php.mdb2-driver-mysql`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-mdb2-driver-mysql package. -``php.ng.mdb2-driver-pgsql`` +``php.mdb2-driver-pgsql`` ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-mdb2-driver-pgsql package. -``php.ng.memcache`` +``php.memcache`` ^^^^^^^^^^^^^^^^^^^ Installs the php-memcache package. Disabled on opensuse need server:php:extensions repo -``php.ng.memcached`` +``php.memcached`` ^^^^^^^^^^^^^^^^^^^^ Installs the php-memcached package. Disabled on opensuse need server:php:extensions repo -``php.ng.modules`` +``php.modules`` ^^^^^^^^^^^^^^^^^^ -Calls ``php.ng.`` for each entry in ``php:ng:modules`` if available, or +Calls ``php.`` for each entry in ``php:modules`` if available, or try to install the matching packages that can be set via from -``php:ng:lookup:pkgs`` +``php:lookup:pkgs`` -``php.ng.mongo`` +``php.mongo`` ^^^^^^^^^^^^^^^^ Installs the php-mongo package. -``php.ng.mongodb`` +``php.mongodb`` ^^^^^^^^^^^^^^^^^^ Installs the php-mongodb package. -``php.ng.msgpack`` +``php.msgpack`` ^^^^^^^^^^^^^^^^^^ Installs the php-msgpack package. -``php.ng.mysql`` +``php.mysql`` ^^^^^^^^^^^^^^^^ Installs the php-mysql package. -``php.ng.mysqlnd`` +``php.mysqlnd`` ^^^^^^^^^^^^^^^^^^ Installs the php-mysqlnd package. Disabled on opensuse no package. -``php.ng.net-smtp`` +``php.net-smtp`` ^^^^^^^^^^^^^^^^^^^ Installs the php-net-smtp package. -``php.ng.net4`` +``php.net4`` ^^^^^^^^^^^^^^^ Installs the php-net4 package. -``php.ng.net6`` +``php.net6`` ^^^^^^^^^^^NET6 Installs the php-net6 package. -``php.ng.oauth`` +``php.oauth`` ^^^^^^^^^^^^^^^^ Installs the php-oauth package. -``php.ng.opcache`` +``php.opcache`` ^^^^^^^^^^^^^^^^^^ Installs the php-opcache package. -``php.ng.openssl`` +``php.openssl`` ^^^^^^^^^^^^^^^^^^ Installs the php-openssl package. -``php.ng.pear`` +``php.pear`` ^^^^^^^^^^^^^^^ Installs the php-pear package. -``php.ng.pgsql`` +``php.pgsql`` ^^^^^^^^^^^^^^^^ Installs the php-pgsql package. -``php.ng.phar`` +``php.phar`` ^^^^^^^^^^^^^^^ Installs the php-phar package. -``php.ng.posix`` +``php.posix`` ^^^^^^^^^^^^^^^^ Installs the php-posix package. -``php.ng.pspell`` +``php.pspell`` ^^^^^^^^^^^^^^^^^ Installs the php-pspell package. -``php.ng.readline`` +``php.readline`` ^^^^^^^^^^^^^^^^^^^ Installs the php-readline package. -``php.ng.redis`` +``php.redis`` ^^^^^^^^^^^^^^^^ Installs the php-redis package. Disabled on opensuse need server:php:extensions repo -``php.ng.seclib`` +``php.seclib`` ^^^^^^^^^^^^^^^^^ Installs the php-seclib package. -``php.ng.session`` +``php.session`` ^^^^^^^^^^^^^^^^^^ Installs the php-session package. -``php.ng.snmp`` +``php.snmp`` ^^^^^^^^^^^^^^^ Installs the php-snmp package. -``php.ng.soap`` +``php.soap`` ^^^^^^^^^^^^^^^ Installs the php-soap package. -``php.ng.sqlite`` +``php.sqlite`` ^^^^^^^^^^^^^^^^^ Installs the php-sqlite package, -``php.ng.ssh2`` +``php.ssh2`` ^^^^^^^^^^^^^^^ Installs the php-ssh2 package, -``php.ng.suhosin`` +``php.suhosin`` ^^^^^^^^^^^^^^^^^^ Installs the php-suhosin package. -``php.ng.svn`` +``php.svn`` ^^^^^^^^^^^^^^ Installs the php-svn package. -``php.ng.sybase`` +``php.sybase`` ^^^^^^^^^^^^^^^^^ Installs the php-sybase package. -``php.ng.tcpdf`` +``php.tcpdf`` ^^^^^^^^^^^^^^^^ Installs the php-tcpdf package. -``php.ng.tidy`` +``php.tidy`` ^^^^^^^^^^^^^^^ Installs the php-tidy package. -``php.ng.uuid`` +``php.uuid`` ^^^^^^^^^^^^^^^ Installs the php-uuid package. -``php.ng.xcache`` +``php.xcache`` ^^^^^^^^^^^^^^^^^ -Meta-state that combines `php.ng.xcache.install`_ and `php.ng.xcache.ini`_. +Meta-state that combines `php.xcache.install`_ and `php.xcache.ini`_. -``php.ng.xcache.ini`` +``php.xcache.ini`` ^^^^^^^^^^^^^^^^^^^^^ Manages the php-xcache ini file -``php.ng.xcache.install`` +``php.xcache.install`` ^^^^^^^^^^^^^^^^^^^^^^^^^ Installs the php-xcache package. Disabled on opensuse need server:php:extensions repo -``php.ng.xdebug`` +``php.xdebug`` ^^^^^^^^^^^^^^^^^ Installs the php-xdebug package. -``php.ng.xml`` +``php.xml`` ^^^^^^^^^^^^^^ Installs the php-xml package. -``php.ng.xsl`` +``php.xsl`` ^^^^^^^^^^^^^^ Installs the php-xsl package. -``php.ng.zip`` +``php.zip`` ^^^^^^^^^^^^^^ Installs the php-zip package. diff --git a/php/adodb.sls b/php/adodb.sls index 2cf3569c..1153b475 100644 --- a/php/adodb.sls +++ b/php/adodb.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-adodb: - pkg.installed: - - name: {{ php.adodb_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'adodb' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ng/apache2/files/mod_php.conf.jinja b/php/apache2/files/mod_php.conf.jinja similarity index 58% rename from php/ng/apache2/files/mod_php.conf.jinja rename to php/apache2/files/mod_php.conf.jinja index 9c70790c..dbb53fa8 100644 --- a/php/ng/apache2/files/mod_php.conf.jinja +++ b/php/apache2/files/mod_php.conf.jinja @@ -1,6 +1,7 @@ -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/map.jinja" import phpng_version with context %} -{% set major = phpng_version.split('.')|first %} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/map.jinja" import php_version with context %} +{%- set major = php_version.split('.')|first %} LoadModule php{{ major }}_module /usr/local/libexec/{{ php.lookup.apache2.name }}/libphp{{ major }}.so diff --git a/php/ng/apache2/ini.sls b/php/apache2/ini.sls similarity index 58% rename from php/ng/apache2/ini.sls rename to php/apache2/ini.sls index 6e9bc398..28ff35be 100644 --- a/php/ng/apache2/ini.sls +++ b/php/apache2/ini.sls @@ -1,12 +1,10 @@ # Manages the main Apache2 ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/ini.jinja" import php_ini %} {% set settings = php.ini.defaults %} {% do settings.update(php.apache2.ini.settings) %} -include: - - php.ng.deprecated - php_apache2_ini: {{ php_ini(php.lookup.apache2.ini, php.apache2.ini.opts, settings) }} diff --git a/php/apache2/init.sls b/php/apache2/init.sls new file mode 100644 index 00000000..1ae01797 --- /dev/null +++ b/php/apache2/init.sls @@ -0,0 +1,13 @@ +{%- if grains['os_family'] in ["Debian", "FreeBSD"] %} +include: + - php.apache2.install +{%- endif %} #END: os = Debian|FreeBSD +{%- if grains['os_family'] == "Debian" %} + - php.apache2.ini + +extend: + php_apache2_ini: + file: + - require: + - sls: php.apache2.install +{%- endif %} #END: os = debian diff --git a/php/apache2/install.sls b/php/apache2/install.sls new file mode 100644 index 00000000..c5fe593c --- /dev/null +++ b/php/apache2/install.sls @@ -0,0 +1,19 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} + +{%- set state = 'apache2' %} +{%- include tplroot ~ "/installed.jinja" %} + +{%- if grains['os_family'] == "FreeBSD" %} +{{ php.lookup.apache2.module_config }}: + file.managed: + - source: salt://php/apache2/files/mod_php.conf.jinja + - template: jinja +{%- if salt['pillar.get']('php:use_apache_formula', True) %} + - makedirs: true + - require_in: + - sls: apache + - watch_in: + - module: apache-restart +{%- endif %} #END: use apache formula +{%- endif %} #END: os = debian diff --git a/php/apc.sls b/php/apc.sls index 2a3d2cab..ba3dc006 100644 --- a/php/apc.sls +++ b/php/apc.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-apc: - pkg.installed: - - name: {{ php.apc_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'apc' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/apcu.sls b/php/apcu.sls index 76eb429a..4739aab1 100644 --- a/php/apcu.sls +++ b/php/apcu.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-apcu: - pkg.installed: - - name: {{ php.apcu_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'apcu' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/auth-sasl.sls b/php/auth-sasl.sls new file mode 100644 index 00000000..b1e5a814 --- /dev/null +++ b/php/auth-sasl.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'auth-sasl' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/bcmath.sls b/php/bcmath.sls index bcfb84f1..42cab2a3 100644 --- a/php/bcmath.sls +++ b/php/bcmath.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-bcmath: - pkg.installed: - - name: {{ php.bcmath_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'bcmath' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/bz2.sls b/php/bz2.sls new file mode 100644 index 00000000..abbd4fe5 --- /dev/null +++ b/php/bz2.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'bz2' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/cache-lite.sls b/php/cache-lite.sls new file mode 100644 index 00000000..81b4e9b3 --- /dev/null +++ b/php/cache-lite.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'cache-lite' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/cgi.sls b/php/cgi.sls index ce53a5f0..de93c79b 100644 --- a/php/cgi.sls +++ b/php/cgi.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-cgi: - pkg.installed: - - name: {{ php.cgi_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'cgi' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/cli.sls b/php/cli.sls deleted file mode 100644 index b7017107..00000000 --- a/php/cli.sls +++ /dev/null @@ -1,9 +0,0 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-cli: - pkg.installed: - - name: {{ php.cli_pkg }} diff --git a/php/cli/ini.sls b/php/cli/ini.sls new file mode 100644 index 00000000..1b94877a --- /dev/null +++ b/php/cli/ini.sls @@ -0,0 +1,27 @@ +# Manages the php cli main ini file +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/ini.jinja" import php_ini %} + +{%- set settings = php.ini.defaults %} +{%- for key, value in php.cli.ini.settings.items() %} + {%- if settings[key] is defined %} + {%- do settings[key].update(value) %} + {%- else %} + {%- do settings.update({key: value}) %} + {%- endif %} +{%- endfor %} + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} + {% for version in pillar_php_version %} + {% set first_version = pillar_php_version[0]|string %} + {% set ini = php.lookup.cli.ini|replace(first_version, version) %} +php_cli_ini_{{ version }}: + {{ php_ini(ini, php.cli.ini.opts, settings) }} + {% endfor %} +{% else %} + +php_cli_ini: + {{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }} +{% endif %} diff --git a/php/cli/init.sls b/php/cli/init.sls new file mode 100644 index 00000000..6d4f9dea --- /dev/null +++ b/php/cli/init.sls @@ -0,0 +1,22 @@ +# Installs php-cli and manages the associated php.ini + +include: + - php.cli.install + - php.cli.ini + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} +extend: + {% for version in pillar_php_version %} + php_cli_ini_{{ version }}: + file: + - require: + - sls: php.cli.install + {% endfor %} +{% else %} +extend: + php_cli_ini: + file: + - require: + - sls: php.cli.install +{% endif %} diff --git a/php/cli/install.sls b/php/cli/install.sls new file mode 100644 index 00000000..6d336c61 --- /dev/null +++ b/php/cli/install.sls @@ -0,0 +1,29 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'cli' %} +{%- include tplroot ~ "/installed.jinja" %} + +{%- if salt['grains.get']('os_family') == "Debian" %} +{%- set current_php = salt['alternatives.show_current']('php') %} +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} + {% if 'alternatives_version' in salt['pillar.get']('php') %} + {% set php_version = salt['pillar.get']('php:alternatives_version') %} + {% else %} + {% set php_version = false %} + {% endif %} +{% else %} +{%- set php_version = salt['pillar.get']('php:version', '7.0')|string %} +{% endif %} + +{% if php_version %} +php_{{ php_version }}_link: + alternatives.set: + - name: php + - path: /usr/bin/php{{ php_version }} + - require_in: + - pkg: php_install_{{ state }} + - onlyif: + - which php + - test {{ current_php }} != $(which php{{ php_version }}) +{%- endif %} +{% endif %} diff --git a/php/composer.sls b/php/composer.sls index e4abc4c9..ad4a94b4 100644 --- a/php/composer.sls +++ b/php/composer.sls @@ -1,22 +1,30 @@ -{%- from "php/map.jinja" import php with context %} +{%- set tplroot = tpldir.split('/')[0] %} +{% from tplroot ~ "/map.jinja" import php with context %} -{%- set install_file = php.local_bin + '/' + php.composer_bin %} +{% set install_file = php.lookup.pkgs.local_bin + '/' + php.lookup.pkgs.composer_bin %} -{%- if not salt['config.get']('sudo_user') %} - {%- set salt_user = salt['config.get']('user', 'root') %} -{%- else %} - {%- set salt_user = salt['config.get']('sudo_user', 'root') %} -{%- endif %} +{% if not salt['config.get']('sudo_user') %} + {% set salt_user = salt['config.get']('user', 'root') %} +{% else %} + {% set salt_user = salt['config.get']('sudo_user', 'root') %} +{% endif %} -{%- set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} +{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} include: - - php.deprecated - php +{% if grains['os_family'] == 'FreeBSD' %} + - php.filter + - php.hash + - php.json + - php.mbstring + - php.openssl + - php.phar +{% endif %} get-composer: file.managed: - - name: {{ php.temp_dir }}/installer + - name: {{ php.lookup.pkgs.temp_dir }}/installer - mode: 0755 - unless: test -f {{ install_file }} - source: https://getcomposer.org/installer @@ -26,7 +34,7 @@ get-composer: install-composer: cmd.run: - - name: php {{ php.temp_dir }}/installer --filename={{ php.composer_bin }} --install-dir={{ php.local_bin }} + - name: php {{ php.lookup.pkgs.temp_dir }}/installer --filename={{ php.lookup.pkgs.composer_bin }} --install-dir={{ php.lookup.pkgs.local_bin }} - unless: test -f {{ install_file }} - env: - HOME: {{ salt_user_home }} @@ -47,7 +55,7 @@ update-composer: {% else %} - unless: test $(date -d "60 days $({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s") {% endif %} - - cwd: {{ php.local_bin }} + - cwd: {{ php.lookup.pkgs.local_bin }} - env: - HOME: {{ salt_user_home }} - require: diff --git a/php/console-table.sls b/php/console-table.sls new file mode 100644 index 00000000..b9337f56 --- /dev/null +++ b/php/console-table.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'console-table' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ctype.sls b/php/ctype.sls new file mode 100644 index 00000000..8b060fa5 --- /dev/null +++ b/php/ctype.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'ctype' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/curl.sls b/php/curl.sls index e633d82a..2720432d 100644 --- a/php/curl.sls +++ b/php/curl.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-curl: - pkg.installed: - - name: {{ php.curl_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'curl' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/dba.sls b/php/dba.sls new file mode 100644 index 00000000..8ba1130d --- /dev/null +++ b/php/dba.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'dba' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/dev.sls b/php/dev.sls index 41e6c62a..24267c20 100644 --- a/php/dev.sls +++ b/php/dev.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-dev: - pkg.installed: - - name: {{ php.dev_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'dev' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/dom.sls b/php/dom.sls new file mode 100644 index 00000000..07862cea --- /dev/null +++ b/php/dom.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'dom' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/fileinfo.sls b/php/fileinfo.sls new file mode 100644 index 00000000..311ddf69 --- /dev/null +++ b/php/fileinfo.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'fileinfo' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ng/files/php.ini b/php/files/php.ini similarity index 100% rename from php/ng/files/php.ini rename to php/files/php.ini diff --git a/php/filter.sls b/php/filter.sls new file mode 100644 index 00000000..a08175ca --- /dev/null +++ b/php/filter.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'filter' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/fpm.sls b/php/fpm.sls deleted file mode 100644 index 0777c296..00000000 --- a/php/fpm.sls +++ /dev/null @@ -1,11 +0,0 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - -php-fpm: - pkg.installed: - - name: {{ php.fpm_pkg }} - service.running: - - name: {{ php.fpm_service }} - - enable: True diff --git a/php/fpm/config.sls b/php/fpm/config.sls new file mode 100644 index 00000000..60a6283f --- /dev/null +++ b/php/fpm/config.sls @@ -0,0 +1,64 @@ +# Manages the php-fpm main ini file +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/ini.jinja" import php_ini %} + +{% set ini_settings = php.ini.defaults %} +{% for key, value in php.fpm.config.ini.settings.items() %} + {% if ini_settings[key] is defined %} + {% do ini_settings[key].update(value) %} + {% else %} + {% do ini_settings.update({key: value}) %} + {% endif %} +{% endfor %} + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} + {% for version in pillar_php_version %} + {% set conf_settings = odict(php.lookup.fpm.defaults) %} + {% set first_version = pillar_php_version[0]|string %} + {% set ini = php.lookup.fpm.ini|replace(first_version, version) %} + {% set conf = php.lookup.fpm.conf|replace(first_version, version) %} + {% set pools = php.lookup.fpm.pools|replace(first_version, version) %} + + {% for key, value in conf_settings.items() %} + {% if value is string %} + {% do conf_settings.update({key: value.replace(first_version, version)}) %} + {% endif %} + {% endfor %} + {% do conf_settings.global.update({'pid': '/var/run/php' + version + '-fpm.pid' }) %} + {% do conf_settings.global.update({'error_log': '/var/log/php' + version + '-fpm.log' }) %} + +php_fpm_ini_config_{{ version }}: + {{ php_ini(ini, php.fpm.config.ini.opts, ini_settings) }} + +php_fpm_conf_config_{{ version }}: + {{ php_ini(conf, php.fpm.config.conf.opts, odict(conf_settings)) }} + +{{ pools }}: + file.directory: + - name: {{ pools }} + - user: {{ php.lookup.fpm.user }} + - group: {{ php.lookup.fpm.group }} + - file_mode: 755 + - make_dirs: True + {% endfor %} +{% else %} + +{% set conf_settings = php.lookup.fpm.defaults %} +{% do conf_settings.update(php.fpm.config.conf.settings) %} + +php_fpm_ini_config: + {{ php_ini(php.lookup.fpm.ini, php.fpm.config.ini.opts, ini_settings) }} + +php_fpm_conf_config: + {{ php_ini(php.lookup.fpm.conf, php.fpm.config.conf.opts, conf_settings) }} + +{{ php.lookup.fpm.pools }}: + file.directory: + - name: {{ php.lookup.fpm.pools }} + - user: {{ php.lookup.fpm.user }} + - group: {{ php.lookup.fpm.group }} + - file_mode: 755 + - make_dirs: True +{% endif %} diff --git a/php/fpm/init.sls b/php/fpm/init.sls new file mode 100644 index 00000000..e7b56cee --- /dev/null +++ b/php/fpm/init.sls @@ -0,0 +1,44 @@ +# Meta-state to fully install php.fpm + +include: + - php.fpm.config + - php.fpm.service + - php.fpm.pools + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +extend: + php_fpm_service: + service: + - watch: + {% if pillar_php_version is iterable and pillar_php_version is not string %} + {% for version in pillar_php_version %} + - file: php_fpm_ini_config_{{ version }} + - file: php_fpm_conf_config_{{ version }} + {% endfor %} + {% else %} + - file: php_fpm_ini_config + - file: php_fpm_conf_config + {% endif %} + - require: + - sls: php.fpm.config + {% if pillar_php_version is iterable and pillar_php_version is not string %} + {% for version in pillar_php_version %} + php_fpm_ini_config_{{ version }}: + file: + - require: + - pkg: php_install_fpm + php_fpm_conf_config_{{ version }}: + file: + - require: + - pkg: php_install_fpm + {% endfor %} + {% else %} + php_fpm_ini_config: + file: + - require: + - pkg: php_install_fpm + php_fpm_conf_config: + file: + - require: + - pkg: php_install_fpm + {% endif %} diff --git a/php/fpm/install.sls b/php/fpm/install.sls new file mode 100644 index 00000000..970c77b0 --- /dev/null +++ b/php/fpm/install.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{% set state = 'fpm' %} +{% include tplroot ~ "/installed.jinja" %} diff --git a/php/ng/fpm/pools.sls b/php/fpm/pools.sls similarity index 56% rename from php/ng/fpm/pools.sls rename to php/fpm/pools.sls index b3d7454f..426b17cd 100644 --- a/php/ng/fpm/pools.sls +++ b/php/fpm/pools.sls @@ -1,7 +1,8 @@ # Manages the php-fpm pools config files -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/macro.jinja" import sls_block %} -{% from "php/ng/fpm/pools_config.sls" import pool_states with context %} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/macro.jinja" import sls_block %} +{%- from tplroot ~ "/fpm/pools_config.sls" import pool_states with context %} {% macro file_requisites(states) %} {%- for state in states %} @@ -10,9 +11,8 @@ {% endmacro %} include: - - php.ng.deprecated - - php.ng.fpm.service - - php.ng.fpm.pools_config + - php.fpm.service + - php.fpm.pools_config {% if pool_states %} extend: diff --git a/php/fpm/pools_config.sls b/php/fpm/pools_config.sls new file mode 100644 index 00000000..e91f5eed --- /dev/null +++ b/php/fpm/pools_config.sls @@ -0,0 +1,46 @@ +# Manages the php-fpm pools config files +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/macro.jinja" import sls_block, serialize %} + +# Simple path concatenation. +{%- macro path_join(file, root) -%} + {{ root ~ '/' ~ file }} +{%- endmacro %} + +{%- set pool_states = [] %} + +{%- for pool, config in php.fpm.pools.items() %} +{%- if pool == 'defaults' %}{% continue %}{% endif %} +{%- for pkey, pvalues in config.get('settings', {}).items() %} +{%- set pool_defaults = php.fpm.pools.get('defaults', {}).copy() %} + {%- do pool_defaults.update(pvalues) %} + {%- do pvalues.update(pool_defaults) %} +{%- endfor %} +{%- set state = 'php_fpm_pool_conf_' ~ loop.index0 %} + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{% if pillar_php_version is iterable and pillar_php_version is not string %} + {% set first_fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} + {% set first_version = pillar_php_version[0]|string %} + {% set fpath = first_fpath.replace(first_version, config.get('phpversion', '7.0')) %} +{% else %} + {% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} +{% endif %} + +{{ state }}: +{%- if config.enabled %} + file.managed: + {{ sls_block(config.get('opts', {})) }} + - name: {{ fpath }} + - source: salt://php/files/php.ini + - template: jinja + - context: + config: {{ serialize(config.get('settings', {})) }} +{%- else %} + file.absent: + - name: {{ fpath }} +{%- endif %} + +{%- do pool_states.append(state) %} +{%- endfor %} diff --git a/php/ng/fpm/service.sls b/php/fpm/service.sls similarity index 64% rename from php/ng/fpm/service.sls rename to php/fpm/service.sls index 084a5395..067580fe 100644 --- a/php/ng/fpm/service.sls +++ b/php/fpm/service.sls @@ -1,12 +1,12 @@ # Manages the php-fpm service. -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/macro.jinja" import sls_block %} +{%- set tplroot = tpldir.split('/')[0] %} +{% from tplroot ~ "/map.jinja" import php with context %} +{% from tplroot ~ "/macro.jinja" import sls_block %} {% set service_function = {True:'running', False:'dead'}.get(php.fpm.service.enabled) %} include: - - php.ng.deprecated - - php.ng.fpm.install + - php.fpm.install php_fpm_service: service.{{ service_function }}: @@ -14,6 +14,6 @@ php_fpm_service: - name: {{ php.lookup.fpm.service }} - enable: {{ php.fpm.service.enabled }} - require: - - sls: php.ng.fpm.install + - sls: php.fpm.install - watch: - pkg: php_install_fpm diff --git a/php/gd.sls b/php/gd.sls index 8761e60b..a75d2f74 100644 --- a/php/gd.sls +++ b/php/gd.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-gd: - pkg.installed: - - name: {{ php.gd_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'gd' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/gearman.sls b/php/gearman.sls new file mode 100644 index 00000000..eed7fd86 --- /dev/null +++ b/php/gearman.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'gearman' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/geoip.sls b/php/geoip.sls new file mode 100644 index 00000000..de5858a9 --- /dev/null +++ b/php/geoip.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'geoip' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/geshi.sls b/php/geshi.sls new file mode 100644 index 00000000..df5c4440 --- /dev/null +++ b/php/geshi.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'geshi' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/gettext.sls b/php/gettext.sls new file mode 100644 index 00000000..cabb24fb --- /dev/null +++ b/php/gettext.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'gettext' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/gmp.sls b/php/gmp.sls new file mode 100644 index 00000000..311d66ce --- /dev/null +++ b/php/gmp.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'gmp' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/hash.sls b/php/hash.sls new file mode 100644 index 00000000..546e6e0f --- /dev/null +++ b/php/hash.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'hash' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/hhvm/config.sls b/php/hhvm/config.sls new file mode 100644 index 00000000..81a6ccab --- /dev/null +++ b/php/hhvm/config.sls @@ -0,0 +1,17 @@ +# Manages the php-hhvm main ini file +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/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) }} + diff --git a/php/ng/hhvm/init.sls b/php/hhvm/init.sls similarity index 74% rename from php/ng/hhvm/init.sls rename to php/hhvm/init.sls index ba6576e3..791925c7 100644 --- a/php/ng/hhvm/init.sls +++ b/php/hhvm/init.sls @@ -1,10 +1,9 @@ # Meta-state to fully install php.hhvm include: - - php.ng.deprecated - - php.ng.hhvm.repo - - php.ng.hhvm.config - - php.ng.hhvm.service + - php.hhvm.repo + - php.hhvm.config + - php.hhvm.service extend: php_hhvm_service: @@ -13,7 +12,7 @@ extend: - file: php_hhvm_ini_config - file: php_hhvm_conf_config - require: - - sls: php.ng.hhvm.config + - sls: php.hhvm.config php_hhvm_ini_config: file: - require: diff --git a/php/hhvm/install.sls b/php/hhvm/install.sls new file mode 100644 index 00000000..40e83585 --- /dev/null +++ b/php/hhvm/install.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'hhvm' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ng/hhvm/repo.sls b/php/hhvm/repo.sls similarity index 68% rename from php/ng/hhvm/repo.sls rename to php/hhvm/repo.sls index 8fd38416..c2c9a168 100644 --- a/php/ng/hhvm/repo.sls +++ b/php/hhvm/repo.sls @@ -1,12 +1,12 @@ # Manages the php-hhvm service. -{% from "php/ng/map.jinja" import php with context %} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} include: - - php.ng.deprecated - - php.ng.hhvm.install + - php.hhvm.install -{% if salt['grains.get']('os_family') == 'Debian' -%} +{%- if salt['grains.get']('os_family') == 'Debian' -%} hhvm_repo: pkgrepo.managed: diff --git a/php/hhvm/service.sls b/php/hhvm/service.sls new file mode 100644 index 00000000..c4685c5f --- /dev/null +++ b/php/hhvm/service.sls @@ -0,0 +1,20 @@ +# Manages the php-hhvm service. +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/macro.jinja" import sls_block %} + +{%- set service_function = {True:'running', False:'dead'}.get(php.hhvm.service.enabled) %} + +include: + - php.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.hhvm.install + - watch: + - pkg: php_install_hhvm + diff --git a/php/http.sls b/php/http.sls new file mode 100644 index 00000000..05e479d8 --- /dev/null +++ b/php/http.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'http' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/iconv.sls b/php/iconv.sls new file mode 100644 index 00000000..999e359c --- /dev/null +++ b/php/iconv.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'iconv' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/igbinary.sls b/php/igbinary.sls new file mode 100644 index 00000000..9d44f059 --- /dev/null +++ b/php/igbinary.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'igbinary' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/imagick.sls b/php/imagick.sls index 1c8cd58a..21e06367 100644 --- a/php/imagick.sls +++ b/php/imagick.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-imagick: - pkg.installed: - - name: {{ php.imagick_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'imagick' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/imap.sls b/php/imap.sls index 79649fa7..36528214 100644 --- a/php/imap.sls +++ b/php/imap.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-imap: - pkg.installed: - - name: {{ php.imap_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'imap' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ini.jinja b/php/ini.jinja new file mode 100644 index 00000000..a4a56dce --- /dev/null +++ b/php/ini.jinja @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# vim: ft=jinja +{#- php.ini management macro. #} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/macro.jinja" import sls_block, serialize %} + +{%- macro php_ini(filename, opts={}, settings={}) %} + file.managed: + {{ sls_block(opts) }} + - name: {{ filename }} + - source: salt://php/files/php.ini + - template: jinja + - context: + config: {{ serialize(odict(settings)) }} +{%- endmacro -%} diff --git a/php/init.sls b/php/init.sls index ab84c03c..01bf941e 100644 --- a/php/init.sls +++ b/php/init.sls @@ -1,33 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - -{%- if not 'ng' in salt['pillar.get']('php', {}) %} - - {%- if grains['os'] == "Ubuntu" %} - {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} - - {%- if use_external_repo %} - {%- set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %} - -php_from_ppa: - pkgrepo.managed: - - ppa: {{ external_repo_name }} - - env: - - LC_ALL: "C.UTF-8" - - require_in: - - pkg: php_from_ppa - pkg.latest: - - name: {{ php.php_pkg }} - - refresh: True - - {%- endif %} - - {%- endif %} - -php: - pkg.installed: - - name: {{ php.php_pkg }} - -{%- endif %} \ No newline at end of file +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'php' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/installed.jinja b/php/installed.jinja new file mode 100644 index 00000000..52abd13a --- /dev/null +++ b/php/installed.jinja @@ -0,0 +1,120 @@ +# -*- coding: utf-8 -*- +# vim: ft=jinja +{#- Template for installing packages #} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/macro.jinja" import sls_block %} + + +{%- set pkginfo = php.lookup.pkgs.get(state) %} + +{%- set pkgs = [] %} +{%- set specials = [] %} + +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{%- if pkginfo is iterable and pkginfo is not string %} + {%- for pkg in pkginfo %} + {%- if pkg is mapping %} + {%- do specials.append(pkg) %} + {%- else %} + {%- do pkgs.append(pkg) %} + {% if pillar_php_version is iterable and pillar_php_version is not string %} + {% set first_version = pillar_php_version[0]|string %} + {% for other_version in pillar_php_version %} + {% set other_version_str = other_version|string %} + {% do pkgs.append(pkg.replace(first_version, other_version_str)) %} + {% endfor %} + {% endif %} + {%- endif %} + {%- endfor %} +{%- else %} + {%- do pkgs.append(pkginfo) %} + {% if pillar_php_version is iterable and pillar_php_version is not string %} + {% set first_version = pillar_php_version[0]|string %} + {% for other_version in pillar_php_version %} + {% set other_version_str = other_version|string %} + {% do pkgs.append(pkginfo.replace(first_version, other_version_str)) %} + {% endfor %} + {% endif %} +{%- endif %} + +{%- if grains['os_family'] == "Debian" and (state == 'cli' or state == 'fpm' or state == 'php') %} + {%- set use_external_repo = salt['pillar.get']('php:use_external_repo', False) %} + + {%- if use_external_repo %} + {%- if grains['os'] == 'Ubuntu' %} + {%- set external_repo_name = salt['pillar.get']('php:external_repo_name', 'ondrej/php') %} +php_ppa_{{ state }}: + pkgrepo.managed: + - ppa: {{ external_repo_name }} + - __env__: + - LC_ALL: C.UTF-8 + - onlyif: + - test ! -e /etc/apt/sources.list.d/ondrej-ubuntu-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #} + - test ! -e /etc/apt/sources.list.d/ondrej-php-{{ grains['oscodename'] }}.list {# Trusty and Xenial use different naming schemas #} + - require_in: + - pkg: php_install_{{ state }} + pkg.latest: + - name: {{ state }} + - pkgs: {{ pkgs|json() }} + - refresh: True + - onchanges: + - pkgrepo: php_ppa_{{ state }} + + {%- else %} + {%- set external_repo_name = salt['pillar.get']('php:external_repo_name', 'packages.sury.org/php' ) %} +php_repo_{{ state }}: + pkg.installed: + - name: apt-transport-https + +php_ppa_{{ state }}: + pkgrepo.managed: + - humanname: {{ external_repo_name }} + - name: deb https://packages.sury.org/php/ {{ grains['oscodename'] }} main + - file: /etc/apt/sources.list.d/ondrej-php.list + - key_url: https://packages.sury.org/php/apt.gpg + - __env__: + - LC_ALL: C.UTF-8 + - onlyif: + - test ! -e /etc/apt/sources.list.d/ondrej-php.list + - require_in: + - pkg: php_install_{{ state }} + pkg.latest: + - name: {{ state }} + - pkgs: {{ pkgs|json() }} + - refresh: True + - onchanges: + - pkgrepo: php_ppa_{{ state }} + + {%- endif %} + {%- endif %} +{%- elif grains['os_family'] == "RedHat" and (state == 'cli' or state == 'fpm' or state == 'php') %} + {%- set use_scl_repo = salt['pillar.get']('php:use_scl_repo', False) %} + {%- set scl_php_version = salt['pillar.get']('php:scl_php_version', 71) %} + {%- set enable_php_repo = salt['pillar.get']('php:lookup:enable_php_repo', False) %} + {%- if use_scl_repo and grains['os'] == 'CentOS' %} +php_centos_scl_enable_{{ state }}: + pkg.installed: + - name: centos-release-scl + {%- elif use_scl_repo and grains['os'] == 'RedHat' %} +php_redhat_scl_enable_{{ state }}: + cmd.run: + - name: yum-config-manager --enable rhel-server-rhscl-{{ grains['osmajorrelease'] }}-rpms + {%- endif %} +{%- endif %} + +php_install_{{ state }}: + pkg.installed: + - name: {{ state }} + - pkgs: {{ pkgs|json() }} +{%- if enable_php_repo is defined and enable_php_repo %} + - enablerepo: {{ enable_php_repo }} +{%- endif %} + +{%- for pkg in specials %} + +php_install_{{ state }}_{{ pkg.get('name') | replace("/", "-") }}: + pkg.installed: + {{ sls_block(pkg) }} + +{%- endfor %} diff --git a/php/intl.sls b/php/intl.sls index 5b594f44..ac253eac 100644 --- a/php/intl.sls +++ b/php/intl.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-intl: - pkg.installed: - - name: {{ php.intl_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'intl' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/json.sls b/php/json.sls index aff16ac2..f6a3a713 100644 --- a/php/json.sls +++ b/php/json.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-json: - pkg.installed: - - name: {{ php.json_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'json' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ldap.sls b/php/ldap.sls index 8c4cab6e..6238c2d5 100644 --- a/php/ldap.sls +++ b/php/ldap.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-ldap: - pkg.installed: - - name: {{ php.ldap_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'ldap' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ng/macro.jinja b/php/macro.jinja similarity index 79% rename from php/ng/macro.jinja rename to php/macro.jinja index 57908204..e47bf680 100644 --- a/php/ng/macro.jinja +++ b/php/macro.jinja @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # vim: ft=jinja -{# Returns a generic block of values suitable for inclusion in most states #} -{% macro sls_block(dict, ind=4) %} - {% for key, value in dict.items() %} +{#- Returns a generic block of values suitable for inclusion in most states #} +{%- macro sls_block(dict, ind=4) %} + {%- for key, value in dict.items() %} {{ '-'|indent(ind, True) }} {{ key }}: {{ value|json() }} - {% endfor %} -{% endmacro %} + {%- endfor %} +{%- endmacro %} {# Serializes dicts into sequenced data #} {%- macro serialize(data) -%} diff --git a/php/mail.sls b/php/mail.sls index 953622af..16e5bc33 100644 --- a/php/mail.sls +++ b/php/mail.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mail: - pkg.installed: - - name : {{ php.mail_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mail' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/map.jinja b/php/map.jinja index f5c476f1..b167a2ab 100644 --- a/php/map.jinja +++ b/php/map.jinja @@ -1,500 +1,3245 @@ # -*- coding: utf-8 -*- # vim: ft=jinja +{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} +{%- if pillar_php_version is iterable and pillar_php_version is not string %} + {%- set php_version = pillar_php_version[0]|string %} +{% else %} + {%- set php_version = pillar_php_version|string %} +{% endif %} +{%- set freebsd_php_version = php_version.replace('.', '') %} + {%- 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', + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + php_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + php_version + '-bcmath', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'bz2': 'php' + php_version + '-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + php_version + '-cgi', + 'cli': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + php_version + '-curl', + 'dba': 'php' + php_version + '-dba', + 'dev': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm': 'php' + php_version + '-fpm', + 'gd': 'php' + php_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + php_version, + 'gmp': 'php' + php_version + '-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php' + php_version + '-imap', + 'intl': 'php' + php_version + '-intl', + 'json': 'php' + php_version + '-json', + 'ldap': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php' + php_version + '-mbstring', + 'mcrypt': 'php' + php_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'mysql': 'php' + php_version + '-mysql', + 'mysqlnd': 'php' + php_version + '-mysql', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + php_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + php_version + '-pgsql', + 'php': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'pspell': 'php' + php_version + '-pspell', + 'redis': 'php' + php_version + '-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php' + php_version + '-snmp', + 'soap': 'php' + php_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': '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': 'php' + php_version + '-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + php_version + '-tidy', + 'xdebug': 'php' + php_version + '-xdebug', + 'xml': 'php' + php_version + '-xml', + 'xsl': 'php' + php_version + '-xsl', + 'zip': 'php' + php_version + '-zip', + }, + 'fpm': { + 'conf': '/etc/php/' + php_version + '/fpm/php-fpm.conf', + 'ini': '/etc/php/' + php_version + '/fpm/php.ini', + 'pools': '/etc/php/' + php_version + '/fpm/pool.d', + 'service': 'php' + php_version + '-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + php_version + '-fpm.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', '/etc/php/' + php_version + '/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': { + 'ini': '/etc/php/' + php_version + '/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/' + php_version + '/apache2/php.ini', + }, + }, + }), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': {}, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'ini': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- else %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + php_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + php_version + '-bcmath', + 'bz2': 'php' + php_version + '-bz2', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + php_version + '-cgi', + 'cli': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + php_version + '-curl', + 'dba': 'php' + php_version + '-dba', + 'dev': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm': 'php' + php_version + '-fpm', + 'gd': 'php' + php_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + php_version, + 'gmp': 'php' + php_version + '-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php' + php_version + '-imap', + 'intl': 'php' + php_version + '-intl', + 'json': 'php' + php_version + '-json', + 'ldap': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php' + php_version + '-mbstring', + 'mcrypt': 'php' + php_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'mysql': 'php' + php_version + '-mysql', + 'mysqlnd': 'php' + php_version + '-mysql', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + php_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + php_version + '-pgsql', + 'php': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'pspell': 'php' + php_version + '-pspell', + 'readline': 'php' + php_version + '-readline', + 'redis': 'php' + php_version + '-redis', + 'seclib': 'php-seclib', + 'snmp': 'php' + php_version + '-snmp', + 'soap': 'php' + php_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': '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': 'php' + php_version + '-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + php_version + '-tidy', + 'xdebug': 'php' + php_version + '-xdebug', + 'xml': 'php' + php_version + '-xml', + 'xsl': 'php' + php_version + '-xsl', + 'zip': 'php' + php_version + '-zip', + }, + 'fpm': { + 'conf': '/etc/php/' + php_version + '/fpm/php-fpm.conf', + 'ini': '/etc/php/' + php_version + '/fpm/php.ini', + 'pools': '/etc/php/' + php_version + '/fpm/pool.d', + 'service': 'php' + php_version + '-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + php_version + '-fpm.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', '/etc/php/' + php_version + '/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': { + 'ini': '/etc/php/' + php_version + '/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/' + php_version + '/apache2/php.ini', + }, + }, + }), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': {}, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'ini': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- endif %} + {%- else %} + {%- if salt['grains.get']('osrelease')|string >= '18.04' %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.2-bcmath', + 'bz2': 'php7.2-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', + 'curl': 'php-curl', + 'dev': 'php7.2-dev', + 'dba': 'php7.2-dba', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gmp': 'php-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php-imap', + 'intl': 'php-intl', + 'json': 'php-json', + 'ldap': 'php-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php7.2-opcache', + 'pear': 'php-pear', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'phpenmod_command': 'phpenmod', + 'pspell': 'php-pspell', + 'redis': 'php-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php-snmp', + 'soap': 'php-soap', + 'sqlite': 'php-sqlite3', + 'ssh2': 'php-ssh2', + 'suhosin': 'php', + 'sybase': 'php-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php7.2-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': 'php-xml', + 'xsl': 'php7.2-xsl', + 'zip': 'php-zip', + }, + 'fpm': { + 'conf': '/etc/php/7.2/fpm/php-fpm.conf', + 'ini': '/etc/php/7.2/fpm/php.ini', + 'pools': '/etc/php/7.2/fpm/pool.d', + 'service': 'php7.2-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php7.2-fpm.pid'), + ('error_log', '/var/log/php7.2-fpm.log'), + ])), + ('include', '/etc/php/7.2/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': { + 'ini': '/etc/php/7.2/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/7.2/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php/7.2/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + }, grain="os"), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + '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': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- elif salt['grains.get']('osrelease')|string >= '17.10' %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.1-bcmath', + 'bz2': 'php7.1-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', + 'curl': 'php-curl', + 'dba': 'php7.1-dba', + 'dev': 'php7.1-dev', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gmp': 'php-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php-imap', + 'intl': 'php-intl', + 'json': 'php-json', + 'ldap': 'php-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php7.1-opcache', + 'pear': 'php-pear', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'phpenmod_command': 'phpenmod', + 'pspell': 'php-pspell', + 'redis': 'php-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php-snmp', + 'soap': 'php-soap', + 'sqlite': 'php-sqlite3', + 'ssh2': 'php-ssh2', + 'suhosin': 'php', + 'sybase': 'php-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php7.1-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': 'php-xml', + 'xsl': 'php7.1-xsl', + 'zip': 'php-zip', + }, + 'fpm': { + 'conf': '/etc/php/7.1/fpm/php-fpm.conf', + 'ini': '/etc/php/7.1/fpm/php.ini', + 'pools': '/etc/php/7.1/fpm/pool.d', + 'service': 'php7.1-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php7.1-fpm.pid'), + ('error_log', '/var/log/php7.1-fpm.log'), + ])), + ('include', '/etc/php/7.1/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': { + 'ini': '/etc/php/7.1/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/7.1/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php/7.1/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + }, grain="os"), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + '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': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- elif salt['grains.get']('osrelease')|string >= '16.04' %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php', + 'apc': 'php', + 'apcu': 'php-apcu', + 'bcmath': 'php7.0-bcmath', + 'bz2': 'php7.0-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php-cgi', + 'cli': 'php-cli', + 'console-table': 'php-console-table', + 'composer_bin': 'composer', + 'curl': 'php-curl', + 'dba': 'php7.0-dba', + 'dev': 'php7.0-dev', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gmp': 'php-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php-imagick', + 'imap': 'php-imap', + 'intl': 'php-intl', + 'json': 'php-json', + 'ldap': 'php-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php-mbstring', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongodb': 'php-mongodb', + 'mysql': 'php-mysql', + 'mysqlnd': 'php', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php7.0-opcache', + 'pear': 'php-pear', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'phpenmod_command': 'phpenmod', + 'pspell': 'php-pspell', + 'redis': 'php-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php-snmp', + 'soap': 'php-soap', + 'sqlite': 'php-sqlite3', + 'ssh2': 'php-ssh2', + 'suhosin': 'php', + 'sybase': 'php-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php7.0-tidy', + 'xcache': 'php', + 'xdebug': 'php-xdebug', + 'xml': 'php-xml', + 'xsl': 'php7.0-xsl', + 'zip': 'php-zip', + }, + 'fpm': { + 'conf': '/etc/php/7.0/fpm/php-fpm.conf', + 'ini': '/etc/php/7.0/fpm/php.ini', + 'pools': '/etc/php/7.0/fpm/pool.d', + 'service': 'php7.0-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php7.0-fpm.pid'), + ('error_log', '/var/log/php7.0-fpm.log'), + ])), + ('include', '/etc/php/7.0/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': { + 'ini': '/etc/php/7.0/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/7.0/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php/7.0/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + }, grain="os"), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + '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': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- else %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Ubuntu': { + 'pkgs': { + 'adodb': 'php5-adodb', + 'apache2': 'libapache2-mod-php5', + 'apc': 'php-apc', + 'apcu': 'php5-apcu', + 'bcmath': 'php5', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php5-cgi', + 'cli': 'php5-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php5-curl', + 'dev': ['php5-dev','build-essential'], + 'ext_conf_path': salt['grains.filter_by']({ + 'precise': '/etc/php5/conf.d', + 'default': '/etc/php5/mods-available', + }, grain='oscodename'), + 'fpm': 'php5-fpm', + 'gd': 'php5-gd', + 'gearman': 'php5-gearman', + 'geoip': 'php5-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-gettext', + 'gmp': 'php5-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php5-imagick', + 'imap': 'php5-imap', + 'intl': 'php5-intl', + 'json': 'php5-json', + 'ldap': 'php5-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php5', + 'mcrypt': 'php5-mcrypt', + 'mdb2': 'php-mdb2', + 'mdb2-driver-mysql': 'php-mdb2-driver-mysql', + 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql', + 'memcache': 'php5-memcache', + 'memcached': 'php5-memcached', + 'mongodb': salt['grains.filter_by']({ + 'trusty': 'php5-mongo', + 'default': '', + }, grain='oscodename'), + 'mysql': 'php5-mysql', + 'mysqlnd': 'php5-mysqlnd', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php5-oauth', + 'opcache': 'php5', + 'pear': 'php-pear', + 'pgsql': 'php5-pgsql', + 'php': 'php5', + 'phpenmod_command': salt['grains.filter_by']({ + 'precise': 'true', + 'default': 'php5enmod', + }, grain='oscodename'), + 'pspell': 'php5-pspell', + 'redis': 'php5-redis', + 'seclib': 'php-seclib', + 'snmp': 'php5-snmp', + 'soap': 'php-soap', + 'sqlite': 'php5-sqlite', + 'ssh2': 'libssh2-php', + 'suhosin5_ext': 'suhosin.so', + 'suhosin5_repo': 'https://github.com/sektioneins/suhosin', + 'suhosin7_ext': 'suhosin7.so', + 'suhosin7_repo': 'https://github.com/sektioneins/suhosin7', + 'svn': 'php5-svn', + 'tcpdf': 'php-tcpdf', + 'tidy': 'php5-tidy', + 'temp_dir': '/tmp', + 'xcache': 'php5-xcache', + 'xdebug': 'php5-xdebug', + 'xml': 'php5', + 'xsl': 'php5-xsl', + 'zip': 'php5', + }, + 'fpm': { + 'conf': '/etc/php5/fpm/php-fpm.conf', + 'ini': '/etc/php5/fpm/php.ini', + 'pools': '/etc/php5/fpm/pool.d', + 'service': 'php5-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php5-fpm.pid'), + ('error_log', '/var/log/php5-fpm.log'), + ])), + ('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': { + 'ini': '/etc/php5/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php5/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php5/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + }, grain="os"), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + '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': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} + {%- endif %} + {%- endif %} +{%- elif salt['grains.get']('os') == "Debian" %} + {%- if php_version|string == '5' %} + {%- set confdir = '/etc/php5' %} + {%- else %} + {%- set confdir = '/etc/php/' + php_version %} + {%- endif %} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'libphp-adodb', + 'apache2': 'libapache2-mod-php' + php_version, + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'bcmath': 'php' + php_version + '-bcmath', + 'bz2': 'php' + php_version + '-bz2', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'pkg-config', 'libsslcommon2-dev', 'gcc', 'make', 'autoconf', 'libc-dev', 'pkg-config'], + 'cache-lite': 'php-cache-lite', + 'cgi': 'php' + php_version + '-cgi', + 'cli': 'php' + php_version + '-cli', + 'composer_bin': 'composer', + 'console-table': 'php-console-table', + 'curl': 'php' + php_version + '-curl', + 'dba': 'php' + php_version + '-dba', + 'dev': 'php' + php_version + '-dev', + 'ext_conf_path': '/etc/php/' + php_version + '/mods-available', + 'fpm': 'php' + php_version + '-fpm', + 'gd': 'php' + php_version + '-gd', + 'gearman': 'php-gearman', + 'geoip': 'php-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php' + php_version, + 'gmp': 'php' + php_version + '-gmp', + 'hhvm': 'hhvm', + 'igbinary': 'php-igbinary', + 'imagick': 'php-imagick', + 'imap': 'php' + php_version + '-imap', + 'intl': 'php' + php_version + '-intl', + 'json': 'php' + php_version + '-json', + 'ldap': 'php' + php_version + '-ldap', + 'local_bin': '/usr/local/bin', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php' + php_version + '-mbstring', + 'mcrypt': 'php' + php_version + '-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'mongo': 'php-mongo', + 'mongodb': 'php-mongodb', + 'msgpack': 'php-msgpack', + 'mysql': 'php' + php_version + '-mysql', + 'mysqlnd': 'php' + php_version + '-mysql', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php-oauth', + 'opcache': 'php' + php_version + '-opcache', + 'pear': 'php-pear', + 'pgsql': 'php' + php_version + '-pgsql', + 'php': 'php' + php_version, + 'phpenmod_command': 'phpenmod -v' + php_version, + 'pspell': 'php' + php_version + '-pspell', + 'readline': 'php' + php_version + '-readline', + 'redis': 'php-redis', + 'seclib': ['php-phpseclib', 'php-seclib'], + 'snmp': 'php' + php_version + '-snmp', + 'soap': 'php' + php_version + '-soap', + 'ssh2': 'php-ssh2', + 'sqlite': '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': 'php' + php_version + '-sybase', + 'tcpdf': 'php-tcpdf', + 'temp_dir': '/tmp', + 'tidy': 'php' + php_version + '-tidy', + 'xdebug': 'php' + php_version + '-xdebug', + 'xml': 'php' + php_version + '-xml', + 'xsl': 'php' + php_version + '-xsl', + 'zip': 'php' + php_version + '-zip', + }, + 'fpm': { + 'conf': confdir + '/fpm/php-fpm.conf', + 'ini': confdir + '/fpm/php.ini', + 'pools': confdir + '/fpm/pool.d', + 'service': 'php' + php_version + '-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php' + php_version + '-fpm.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', confdir + '/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': { + 'ini': confdir + '/cli/php.ini', + }, + 'apache2': { + 'ini': confdir + '/apache2/php.ini', + }, + }, + }), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': {}, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, + }, + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'apache2': { + 'ini': { + 'opts': {}, + 'settings': {}, + } + }, + 'ini': { + 'defaults': { + 'PHP': { + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'engine': 'On', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, + }, + }, merge=True) %} +{%- else %} + {%- set useversion = php_version | replace(".", "-") -%} + {#- Red Hat Softwarecollection prefix lookup belongs to the Red Hat part + further down but has to go here due to Jinja parsing rules. -#} + {%- if salt['pillar.get']('php:use_scl_repo', False) -%} + {%- set rh_prefix = 'rh-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%} + {%- set sclo_prefix = 'sclo-php{}-'.format(salt['pillar.get']('php:scl_php_version', '')) -%} + {%- set path_suffix = 'opt/rh/rh-php{}/'.format(salt['pillar.get']('php:scl_php_version', '')) -%} + {%- else -%} + {%- set rh_prefix = '' -%} + {%- set sclo_prefix = '' -%} + {%- set path_suffix = '' -%} + {%- endif -%} + {%- set php = salt['pillar.get']('php', { + 'lookup': salt['grains.filter_by']({ + 'Debian': { + 'pkgs': { + 'adodb': 'php5-adodb', + 'apache2': 'libapache2-mod-php5', + 'apc': 'php-apc', + 'apcu': 'php5-apcu', + 'bcmath': 'php5', + 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev'], + 'bz2': 'php5-bz2', + 'cache-lite': 'php-cache-lite', + 'cgi': 'php5-cgi', + 'cli': 'php5-cli', + 'console-table': 'php-console-table', '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', + 'curl': 'php5-curl', + 'dba': 'php5-dba', + 'dev': ['php5-dev','build-essential'], + 'ext_conf_path': '/etc/php5/mods-available', + 'fpm': 'php5-fpm', + 'gd': 'php5-gd', + 'gearman': 'php5-gearman', + 'geoip': 'php5-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-gettext', + 'gmp': 'php5-gmp', + 'hhvm': 'hhvm', + 'imagick': 'php5-imagick', + 'imap': 'php5-imap', + 'intl': 'php5-intl', + 'json': 'php5-json', + 'ldap': 'php5-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', + 'auth-sasl': 'php-auth-sasl', + 'mail': 'php-mail', + 'mbstring': 'php5', + 'mcrypt': 'php5-mcrypt', + 'mdb2': 'php-mdb2', + 'mdb2-driver-mysql': 'php-mdb2-driver-mysql', + 'mdb2-driver-pgsql': 'php-mdb2-driver-pgsql', + 'memcache': 'php5-memcache', + 'memcached': 'php5-memcached', + 'mysql': 'php5-mysql', + 'mysqlnd': 'php5-mysqlnd', + 'net-smtp': 'php-net-smtp', + 'net4': 'php-net-ipv4', + 'net6': 'php-net-ipv6', + 'oauth': 'php5-oauth', + 'opcache': 'php5', + 'pear': 'php-pear', + 'pgsql': 'php5-pgsql', + 'php': 'php5', + 'phpenmod_command': 'php5enmod', + 'pspell': 'php5-pspell', + 'redis': 'php5-redis', + 'seclib': 'php-seclib', + 'snmp': 'php5-snmp', + 'soap': 'php-soap', + 'sqlite': 'php5-sqlite', + 'ssh2': 'php5-ssh2', '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', + 'svn': 'php5-svn', + 'sybase': 'php5-sybase', + 'tcpdf': 'php-tcpdf', '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', + 'tidy': 'php5-tidy', + 'uuid': 'php-uuid', + 'xcache': 'php5-xcache', + 'xdebug': 'php5-xdebug', + 'xml': 'php5', + 'xsl': 'php5-xsl', + 'zip': 'php5', + }, + 'fpm': { + 'conf': '/etc/php5/fpm/php-fpm.conf', + 'ini': '/etc/php5/fpm/php.ini', + 'pools': '/etc/php5/fpm/pool.d', + 'service': 'php5-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php5-fpm.pid'), + ('error_log', '/var/log/php5-fpm.log'), + ])), + ('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': { + 'ini': '/etc/php5/cli/php.ini', + }, + 'apache2': { + 'ini': '/etc/php5/apache2/php.ini', + }, + 'xcache': { + 'ini': '/etc/php5/mods-available/xcache.ini', + 'defaults': {}, + }, + }, + 'Gentoo' : { + 'pkgs': { + 'apache2': [{'name': 'dev-lang/php','version': ':' + php_version + '[apache2]'}], + 'apc': [{'name': 'dev-php/pecl-apcu_bc','version': '[php_targets_php' + useversion + ']'}], + 'apcu': [{'name': 'dev-php/pecl-apcu','version': '[php_targets_php' + useversion + ']'}], + 'bcmath': [{'name': 'dev-lang/php','version': ':' + php_version + '[bcmath]'}], + 'bz2': [{'name': 'dev-lang/php','version': ':' + php_version + '[bzip2]'}], + 'cache-lite': 'dev-php/PEAR-Cache_Lite', + 'cgi': [{'name': 'dev-lang/php','version': ':' + php_version + '[cgi]'}], + 'cli': [{'name': 'dev-lang/php','version': ':' + 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', + 'console-table': 'dev-php/PEAR-Console_Table', + 'curl': [{'name': 'dev-lang/php','version': ':' + php_version + '[curl]'}], + 'ext_conf_path': '/etc/php/fpm-php' + php_version + '/ext', + 'fpm': [{'name': 'dev-lang/php','version': ':' + php_version + '[fpm]'}], + 'gd': [{'name': 'dev-lang/php','version': ':' + php_version + '[gd]'}], + 'geoip': [{'name': 'dev-php/pecl-geoip','version': '[php_targets_php' + useversion + ']'}], + 'gettext': 'dev-php/PEAR-File_Gettext', + 'gmp': [{'name': 'dev-lang/php','version': ':' + php_version + '[gmp]'}], + 'imagick': [{'name': 'dev-php/pecl-imagick','version': '[php_targets_php' + useversion + ']'}], + 'imap': [{'name': 'dev-lang/php','version': ':' + php_version + '[imap]'}], + 'intl': [{'name': 'dev-lang/php','version': ':' + php_version + '[intl]'}], + 'json': [{'name': 'dev-lang/php','version': ':' + php_version + '[json]'}], + 'ldap': [{'name': 'dev-lang/php','version': ':' + 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', + 'auth-sasl': 'dev-php/PEAR-Auth_SASL', + 'mail': 'dev-php/PHPMailer', + 'memcache': [{'name': 'dev-php/pecl-memcache','version': '[php_targets_php' + useversion + ']'}], + 'memcached': [{'name': 'dev-php/pecl-memcached','version': '[php_targets_php' + useversion + ']'}], + 'mongo': [{'name': 'dev-php/pecl-mongo','version': '[php_targets_php' + useversion + ']'}], + 'mongodb': [{'name': 'dev-php/pecl-mongodb','version': '[php_targets_php' + useversion + ']'}], + 'mysqlnd': [{'name': 'dev-lang/php','version': ':' + php_version + '[mysql]'}], + 'mysql': [{'name': 'dev-lang/php','version': ':' + php_version + '[mysqli]'}], + 'net-smtp': 'dev-php/PEAR-Net_SMTP', + 'net4': 'dev-php/PEAR-Net_IPv4', + 'net6': 'dev-php/PEAR-Net_IPv6', + 'oauth': [{'name': 'dev-php/pecl-oauth','version': '[php_targets_php' + useversion + ']'}], + 'opcache': [{'name': 'dev-lang/php','version': ':' + php_version + '[opcache]'}], + 'pear': 'dev-php/pear', + 'pgsql': [{'name': 'dev-lang/php','version': ':' + php_version + '[postgres]'}], + 'php': [{'name': 'dev-lang/php','version': ':' + php_version}], + 'pspell': [{'name': 'dev-lang/php','version': ':' + php_version + '[spell]'}], + 'redis': [{'name': 'dev-php/pecl-redis','version': '[php_targets_php' + useversion + ']'}], + 'snmp': [{'name': 'dev-lang/php','version': ':' + php_version + '[snmp]'}], + 'soap': [{'name': 'dev-lang/php','version': ':' + php_version + '[soap]'}], + 'ssh2': [{'name': 'dev-php/pecl-ssh2','version': '[php_targets_php' + useversion + ']'}], + 'sqlite': [{'name': 'dev-lang/php','version': ':' + php_version + '[sqlite]'}], + 'sybase': [{'name': 'dev-lang/php','version': ':' + php_version + '[sybase-ct]'}], + 'tcpdf': 'dev-php/tcpdf', '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', + 'tidy': [{'name': 'dev-lang/php','version': ':' + php_version + '[tidy]'}], + 'xdebug': [{'name': 'dev-lang/php','version': ':' + php_version + '[debug]'}], + 'xml': [{'name': 'dev-lang/php','version': ':' + php_version + '[xml]'}], + 'xsl': [{'name': 'dev-lang/php','version': ':' + php_version + '[xslt]'}], + 'zip': [{'name': 'dev-lang/php','version': ':' + php_version + '[zip]'}], + }, + 'fpm': { + 'conf': '/etc/php/fpm-php' + php_version + '/php-fpm.conf', + 'ini': '/etc/php/fpm-php' + php_version + '/php.ini', + 'pools': '/etc/php/fpm-php' + php_version + '/fpm.d', + 'service': 'php-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': odict([ + ('global', odict([ + ('pid', '/var/run/php-fpm-php' + php_version + '.pid'), + ('error_log', '/var/log/php' + php_version + '-fpm.log'), + ])), + ('include', '/etc/php/fpm-php' + php_version + '/fpm.d/*.conf'), + ]), + }, + 'cli': { + 'ini': '/etc/php/cli-php' + php_version + '/php.ini', + }, + 'apache2': { + 'ini': '/etc/php/apache2-php' + php_version + '/php.ini', + }, + }, + 'RedHat': { + 'pkgs': { + 'adodb': 'php-adodb', + 'apc': 'php-pecl-apc', + 'apcu': rh_prefix + 'php-pecl-apcu', + 'bcmath': rh_prefix + 'php-bcmath', + 'build_pkgs': ['openssl-devel', 'gcc'], + 'cache-lite': 'php-pear-Cache-Lite', + 'cgi': rh_prefix + 'php-cgi', + 'cli': rh_prefix + 'php-cli', + 'composer': 'composer', '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', + 'console-table': 'php-pear-Console-Table', + 'curl': [rh_prefix + 'php-common', 'curl'], + 'dba': [rh_prefix + 'php-dba', 'dba'], + 'dev': rh_prefix + 'php-devel', + 'ext_conf_path': '/etc/' + path_suffix + 'php.d', + 'fpm': rh_prefix + 'php-fpm', + 'gd': rh_prefix + 'php-gd', + 'geoip': sclo_prefix + 'php-pecl-geoip', + 'geshi': 'php-geshi', + 'gettext': 'php-php-gettext', + 'http': sclo_prefix + 'php-pecl-http', + 'imagick': sclo_prefix + 'php-pecl-imagick', + 'imap': sclo_prefix + 'php-imap', + 'intl': rh_prefix + 'php-intl', + 'json': rh_prefix + 'php-common', + 'ldap': rh_prefix + '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', + 'auth-sasl': 'php-pear-Auth-SASL', + 'mail': 'php-pear-Mail', + 'mbstring': rh_prefix + 'php-mbstring', + 'mcrypt': sclo_prefix + 'php-mcrypt', + 'memcache': 'php-pecl-memcache', + 'memcached': sclo_prefix + 'php-pecl-memcached', + 'mysql': 'php-mysql', + 'mysqlnd': rh_prefix + 'php-mysqlnd', + 'net-smtp': 'php-pear-Net-SMTP', + 'net4': 'php-pear-Net-IPv4', + 'oauth': 'php-pecl-oauth', + 'opcache': rh_prefix + 'php-opcache' if salt['pillar.get']('php:use_scl_repo', False) else 'php-pecl-zendopcache', + 'pear': rh_prefix + 'php-pear', + 'pgsql': rh_prefix + 'php-pgsql', + 'php': rh_prefix + 'php', + 'pspell': rh_prefix + 'php-pspell', + 'redis': sclo_prefix + 'php-pecl-redis', + 'seclib': 'php-phpseclib', + 'snmp': rh_prefix + 'php-snmp', + 'soap': rh_prefix + 'php-soap', + 'sqlite': rh_prefix + 'php-pdo', + 'ssh2': sclo_prefix + 'php-pecl-ssh2', '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', + 'tcpdf': 'php-tcpdf', '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', + 'tidy': sclo_prefix + 'php-tidy', + 'uuid': sclo_prefix + 'php-pecl-uuid', + 'xcache': 'php-xcache', + 'xdebug': sclo_prefix + 'php-pecl-xdebug', + 'xml': rh_prefix + 'php-xml', + 'xsl': rh_prefix + 'php-xml', + 'zip': rh_prefix + 'php', + }, + 'fpm': { + 'conf': '/etc/' + path_suffix + 'php-fpm.conf', + 'ini': '/etc/' + path_suffix + 'php.ini', + 'pools': '/etc/' + path_suffix + 'php-fpm.d', + 'service': rh_prefix + 'php-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': { + 'global': { + 'pid': '/var/' + path_suffix + 'run/php-fpm/php-fpm.pid', + 'error_log': '/var/' + path_suffix + 'log/php-fpm/error.log', + }, + 'include': '/etc/' + path_suffix + 'php-fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/' + path_suffix + 'php.ini', + }, + 'xcache': { + 'ini': '/etc/' + path_suffix + 'php.d/xcache.ini', + }, + }, + 'Suse': { + 'pkgs': { + 'adodb': 'php5-dba', + 'apache2': 'apache2-mod_php5', + 'cli': 'php5', + 'curl': 'php5-curl', + 'fpm': 'php5-fpm', + 'gd': 'php5-gd', + 'imap': 'php5-imap', + 'intl': 'php5-intl', + 'json': 'php5-json', + 'ldap': 'php5-ldap', + 'mbstring': 'php5-mbstring', + 'mcrypt': 'php5-mcrypt', + 'mysql': 'php5-mysql', + 'oauth': 'php5-oauth', + 'pear': 'php5-pear', + 'pgsql': 'php5-pgsql', + 'php': 'php5', + 'snmp': 'php5-snmp', + 'soap': 'php5-soap', + 'sqlite': 'php5-sqlite', + 'suhosin': 'php5-suhosin', + 'xml': ['php5-xmlreader','php5-xmlwriter','php5-xmlrpc'], + 'zip': 'php5-zip', + }, + 'fpm': { + 'conf': '/etc/php-fpm.conf', + 'ini': '/etc/php.ini', + 'pools': '/etc/php-fpm.d', + 'service': 'php-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': { + 'global': { + 'pid': '/var/run/php-fpm/php-fpm.pid', + 'error_log': '/var/log/php-fpm/error.log', + }, + 'include': '/etc/php-fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/php.ini', + }, + }, + 'Arch': { + 'pkgs': { + 'apc': 'php-apcu', + 'apcu': 'php-apcu-bc', + 'cgi': 'php-cgi', + 'cli': 'php', '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', + 'curl': 'curl', + 'fpm': 'php-fpm', + 'gd': 'php-gd', + 'geoip': 'php-geoip', + 'imap': 'php-imap', + 'intl': 'php-intl', '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', + 'mcrypt': 'php-mcrypt', + 'memcache': 'php-memcache', + 'memcached': 'php-memcached', + 'pgsql': 'php-pgsql', + 'php': 'php', + 'pspell': 'php-pspell', + 'snmp': 'php-snmp', + 'sqlite': 'php-sqlite', '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', + 'tidy': 'php-tidy', + 'xcache': 'php-xcache', + 'xdebug': 'xdebug', + 'xsl': 'php-xsl', + }, + 'fpm': { + 'conf': '/etc/php/php-fpm.conf', + 'ini': '/etc/php/php.ini', + 'pools': '/etc/php/fpm.d', + 'service': 'php-fpm', + 'user': 'root', + 'group': 'root', + 'defaults': { + 'global': { + 'pid': '/run/php-fpm/php-fpm.pid', + 'error_log': 'log/php-fpm.log', + }, + 'include': '/etc/php/fpm.d/*.conf', + }, + }, + 'cli': { + 'ini': '/etc/php/php-cli.ini', + }, + 'xcache': { + 'ini': '/etc/php/conf.d/xcache.ini', + }, + }, + 'FreeBSD': { + 'apache2': { + 'ini': '/usr/local/etc/php.ini', + 'module_config': '/usr/local/etc/apache24/modules.d/050_mod_php.conf', + 'name': 'apache24', + }, + 'cli': { + 'ini': '/usr/local/etc/php.ini' + }, + 'pkgs': { + 'apache2': 'mod_php' + freebsd_php_version, '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', + 'cli': 'php' + freebsd_php_version, + 'ctype': 'php' + freebsd_php_version + '-ctype', + 'curl': 'php' + freebsd_php_version + '-curl', + 'dom': 'php' + freebsd_php_version + '-dom', + 'filter': 'php' + freebsd_php_version + '-filter', + 'fileinfo': 'php' + freebsd_php_version + '-fileinfo', + 'fpm': 'php' + freebsd_php_version, + 'gd': 'php' + freebsd_php_version + '-gd', + 'hash': 'php' + freebsd_php_version + '-hash', + 'iconv': 'php' + freebsd_php_version + '-iconv', + 'intl': 'php' + freebsd_php_version + '-intl', + 'json': 'php' + freebsd_php_version + '-json', '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', + 'memcached': 'php' + freebsd_php_version + '-pecl-memcached', + 'mbstring': 'php' + freebsd_php_version + '-mbstring', + 'mcrypt': 'php' + freebsd_php_version + '-mcrypt', + 'mysql': 'php' + freebsd_php_version + '-mysqli', + 'opcache': 'php' + freebsd_php_version + '-opcache', + 'openssl': 'php' + freebsd_php_version + '-openssl', + 'pdo': 'php' + freebsd_php_version + '-pdo', + 'pdo_mysql': 'php' + freebsd_php_version + '-pdo_mysql', + 'pear': 'php' + freebsd_php_version + '-pear', + 'php': 'php' + freebsd_php_version, + 'phar': 'php' + freebsd_php_version + '-phar', + 'posix': 'php' + freebsd_php_version + '-posix', + 'session': 'php' + freebsd_php_version + '-session', + 'simplexml': 'php' + freebsd_php_version + '-simplexml', + 'snmp': 'php' + freebsd_php_version + '-snmp', 'temp_dir': '/tmp', - 'xml_pkg': 'php5', - 'zip_pkg': 'php5', + 'tokenizer': 'php' + freebsd_php_version + '-tokenizer', + 'xdebug': 'php' + freebsd_php_version + '-pecl-xdebug', + 'xml': 'php' + freebsd_php_version + '-xml', + 'xmlwriter': 'php' + freebsd_php_version + '-xmlwriter', + 'zip': 'php' + freebsd_php_version + '-zip', }, - }, grain='os', merge=salt['pillar.get']('php:lookup')) %} - {%- endif %} - {%- endif %} -{%- else %} - {%- set php = salt['grains.filter_by']({ - 'Debian': { - 'adodb_pkg': salt['grains.filter_by']({ - 'jessie': 'php5-adodb', - 'stretch': 'libphp-adodb', - }, grain='oscodename'), - 'apc_pkg': 'php-apc', - 'apcu_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-apc', - 'jessie': 'php5-apcu', - 'stretch': 'php-apcu', - }, grain='oscodename'), - 'bcmath_pkg': 'php5-fpm', - 'build_pkgs': ['libssl-dev', 'libcurl4-openssl-dev', 'build-essential'], - 'cgi_pkg': 'php5-cgi', - 'cli_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-cli', - 'jessie': 'php5-cli', - 'stretch': 'php-cli', - }, grain='oscodename'), - 'composer_bin': 'composer', - 'curl_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-curl', - 'jessie': 'php5-curl', - 'stretch': 'php-curl', - }, grain='oscodename'), - 'dev_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-dev', - 'jessie': 'php5-dev', - 'stretch': 'php-dev', - }, grain='oscodename'), - 'ext_conf_path': salt['grains.filter_by']({ - 'jessie': '/etc/php5/mods-available', - 'stretch': '/etc/php/7.0/mods-available/', - }, grain='oscodename'), - 'fpm_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-fpm', - 'jessie': 'php5-fpm', - 'stretch': 'php-fpm', - }, grain='oscodename'), - 'fpm_service': salt['grains.filter_by']({ - 'wheezy': 'php-fpm', - 'jessie': 'php5-fpm', - 'stretch': 'php-fpm', - }, grain='oscodename'), - 'gd_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-gd', - 'jessie': 'php5-gd', - 'stretch': 'php-gd', - }, grain='oscodename'), - 'imagick_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-imagick', - 'jessie': 'php5-imagick', - 'stretch': 'php-imagick', - }, grain='oscodename'), - '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': salt['grains.filter_by']({ - 'wheezy': 'php-mcrypt', - 'jessie': 'php5-mcrypt', - 'stretch': 'php-mcrypt', - }, grain='oscodename'), - 'memcache_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-memcache', - 'jessie': 'php5-memcache', - 'stretch': 'php-memcache', - }, grain='oscodename'), - 'memcached_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-memcached', - 'jessie': 'php5-memcached', - 'stretch': 'php-memcached', - }, grain='oscodename'), - 'mongo_ext': 'mongo.so', - 'mongo_pecl': 'mongo', - 'mysql_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-mysql', - 'jessie': 'php5-mysql', - 'stretch': 'php-mysql', - }, grain='oscodename'), - 'mysqlnd_pkg': 'php5-mysqlnd', - 'oauth_pkg': 'php5-oauth', - 'pear_pkg': 'php-pear', - 'pgsql_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-pgsql', - 'jessie': 'php5-pgsql', - 'stretch': 'php-pqsql', - }, grain='oscodename'), - 'php_ini': salt['grains.filter_by']({ - 'jessie': '/etc/php5/apache2/php.ini', - 'stretch': '/etc/php/7.0/apache2/php.ini', - }, grain='oscodename'), - 'php_pkg': salt['grains.filter_by']({ - 'wheezy': 'php', - 'jessie': 'php5', - 'stretch': 'php', - }, grain='oscodename'), - 'phpenmod_command': salt['grains.filter_by']({ - 'wheezy': 'php5enmod', - 'jessie': 'php5enmod', - 'stretch': 'phpenmod', - }, grain='oscodename'), - 'readline_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-readline', - 'jessie': 'php5-readline', - 'stretch': 'php-readline', - }, grain='oscodename'), - 'redis_pkg': salt['grains.filter_by']({ - 'wheezy': 'php-redis', - 'jessie': 'php5-redis', - 'stretch': 'php-redis', - }, grain='oscodename'), - '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', + 'fpm': { + 'conf': '/usr/local/etc/php-fpm.conf', + 'ini': '/usr/local/etc/php.ini', + 'pools': '/usr/local/etc/php-fpm.d', + 'service': 'php-fpm', + 'user': 'root', + 'group': 'wheel', + 'defaults': { + 'global': { + 'pid': 'run/php-fpm.pid', + 'error_log': 'log/php-fpm.log', + }, + 'include': '/usr/local/etc/php-fpm.d/*.conf', + }, + }, + }, + }), + 'fpm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'ini': { + 'opts': {}, + 'settings': {}, + }, + 'conf': { + 'opts': {}, + 'settings': {}, + }, + }, + 'pools': { + 'default.conf': { + 'enabled': False, + 'opts': {}, + }, + }, + }, + 'hhvm': { + 'service': { + 'enabled': True, + 'opts': {}, + }, + 'config': { + 'server': { + 'opts': {}, + 'settings': {}, + }, + 'php': { + 'opts': {}, + 'settings': {}, + }, + }, }, - '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', + 'cli': { + 'ini': { + 'opts': {}, + 'settings': {}, + } }, - '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', + 'apache2': { + 'ini': { + 'opts': {}, + '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': {}, + } }, - 'FreeBSD': { - 'local_bin': '/usr/local/bin', - 'composer_bin': 'composer', - 'temp_dir': '/tmp', + 'ini': { + 'defaults': { + 'PHP': { + 'engine': 'On', + 'allow_url_fopen': 'On', + 'allow_url_include': 'Off', + 'asp_tags': 'Off', + 'auto_globals_jit': 'On', + 'default_mimetype': '"text/html"', + 'default_socket_timeout': 60, + 'disable_functions': ['pcntl_alarm','pcntl_fork','pcntl_waitpid','pcntl_wait','pcntl_wifexited','pcntl_wifstopped','pcntl_wifsignaled', + 'pcntl_wexitstatus','pcntl_wtermsig','pcntl_wstopsig','pcntl_signal','pcntl_signal_dispatch','pcntl_get_last_error','pcntl_strerror', + 'pcntl_sigprocmask','pcntl_sigwaitinfo','pcntl_sigtimedwait','pcntl_exec','pcntl_getpriority','pcntl_setpriority'], + 'display_errors': 'Off', + 'display_startup_errors': 'Off', + 'enable_dl': 'Off', + 'error_reporting': ['E_ALL', '~E_DEPRECATED', '~E_STRICT'], + 'expose_php': 'On', + 'file_uploads': 'On', + 'html_errors': 'On', + 'ignore_repeated_errors': 'Off', + 'ignore_repeated_source': 'Off', + 'implicit_flush': 'Off', + 'log_errors': 'On', + 'log_errors_max_len': 1024, + 'max_execution_time': 30, + 'max_file_uploads': 20, + 'max_input_nesting_level': 64, + 'max_input_time': 60, + 'max_input_vars': 1000, + 'memory_limit': '128M', + 'output_buffering': 4096, + 'post_max_size': '8M', + 'precision': 14, + 'register_argc_argv': 'Off', + 'report_memleaks': 'On', + 'request_order': 'GP', + 'serialize_precision': 17, + 'short_open_tag': 'Off', + 'track_errors': 'Off', + 'upload_max_filesize': '2M', + 'variables_order': 'GPCS', + 'zend.enable_gc': 'On', + 'zlib.output_compression': 'Off', + }, + 'CLI Server': { + 'cli_server.color': 'On' + }, + 'Date': { + 'date.timezone': 'America/New_York' + }, + 'Pdo_mysql': { + 'pdo_mysql.cache_size': 2000 + }, + 'mail function': { + 'SMTP': 'localhost', + 'mail.add_x_header': 'On' + }, + 'SQL': { + 'sql.safe_mode': 'Off' + }, + 'ODBC': { + 'odbc.allow_persistent': 'On', + 'odbc.check_persistent': 'On', + 'odbc.max_persistent': '-1', + 'odbc.max_links': '-1', + 'odbc.defaultlrl': 4096, + 'odbc.defaultbinmode': 1 + }, + 'Interbase': { + 'ibase.allow_persistent': 1, + 'ibase.max_persistent': -1, + 'ibase.max_links': -1, + 'ibase.timestampformat': '"%Y-%m-%d %H:%M:%S"', + 'ibase.dateformat': '"%Y-%m-%d"', + 'ibase.timeformat': '"%H:%M:%S"' + }, + 'MySQL': { + 'mysql.allow_local_infile': 'On', + 'mysql.allow_persistent': 'On', + 'mysql.cache_size': '2000', + 'mysql.max_persistent': -1, + 'mysql.max_links': -1, + 'mysql.connect_timeout': 60, + 'mysql.trace_mode': 'Off' + }, + 'MySQLi': { + 'mysqli.max_persistent': -1, + 'mysqli.allow_persistent': 'On', + 'mysqli.max_links': -1, + 'mysqli.cache_size': 2000, + 'mysqli.default_port': 3306, + 'mysqli.reconnect': 'Off' + }, + 'mysqlnd': { + 'mysqlnd.collect_statistics': 'On', + 'mysqlnd.collect_memory_statistics': 'Off' + }, + 'PostgreSQL': { + 'pgsql.allow_persistent': 'On', + 'pgsql.auto_reset_persistent': 'Off', + 'pgsql.max_persistent': -1, + 'pgsql.max_links': -1, + 'pgsql.ignore_notice': 0, + 'pgsql.log_notice': 0 + }, + 'Sybase-CT': { + 'sybct.allow_persistent': 'On', + 'sybct.max_persistent': -1, + 'sybct.max_links': -1, + 'sybct.min_server_severity': 10, + 'sybct.min_client_severity': 10 + }, + 'bcmath': { + 'bcmath.scale': 0 + }, + 'Session': { + 'session.save_handler': 'files', + 'session.use_strict_mode': 0, + 'session.use_cookies': 1, + 'session.use_only_cookies': 1, + 'session.name': 'PHPSESSID', + 'session.auto_start': 0, + 'session.cookie_lifetime': 0, + 'session.cookie_path': '/', + 'session.serialize_handler': 'php', + 'session.gc_probability': 0, + 'session.gc_divisor': 1000, + 'session.gc_maxlifetime': 1440, + 'session.bug_compat_42': 'Off', + 'session.bug_compat_warn': 'Off', + 'session.cache_limiter': 'nocache', + 'session.cache_expire': '180', + 'session.use_trans_sid': 0, + 'session.hash_function': 0, + 'session.hash_bits_per_character': 5, + 'url_rewriter.tags': '"a=href,area=href,frame=src,input=src,form=fakeentry"' + }, + 'MSSQL': { + 'mssql.allow_persistent': 'On', + 'mssql.max_persistent': -1, + 'mssql.max_links': -1, + 'mssql.min_error_severity': 10, + 'mssql.min_message_severity': 10, + 'mssql.compatibility_mode': 'Off', + 'mssql.secure_connection': 'Off' + }, + 'Tidy': { + 'tidy.clean_output': 'Off' + }, + 'soap': { + 'soap.wsdl_cache_enabled': 1, + 'soap.wsdl_cache_dir': '"/tmp"', + 'soap.wsdl_cache_ttl': 86400, + 'soap.wsdl_cache_limit': 5 + }, + 'ldap': { + 'ldap.max_links': -1 + }, + }, }, - }, merge=salt['pillar.get']('php:lookup')) %} + }, merge=True) %} {%- endif %} diff --git a/php/mbstring.sls b/php/mbstring.sls index b285467d..b4648390 100644 --- a/php/mbstring.sls +++ b/php/mbstring.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mbstring: - pkg.installed: - - name: {{ php.mbstring_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mbstring' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/mcrypt.sls b/php/mcrypt.sls index 95fa37ad..6c7a6fdf 100644 --- a/php/mcrypt.sls +++ b/php/mcrypt.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mcrypt: - pkg.installed: - - name: {{ php.mcrypt_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mcrypt' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/mdb2/init.sls b/php/mdb2/init.sls new file mode 100644 index 00000000..70a78ae0 --- /dev/null +++ b/php/mdb2/init.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mdb2' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/mdb2/mysql.sls b/php/mdb2/mysql.sls new file mode 100644 index 00000000..e09a383e --- /dev/null +++ b/php/mdb2/mysql.sls @@ -0,0 +1,4 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mdb2-driver-mysql' %} +{%- include tplroot ~ "/installed.jinja" %} +{%- include tplroot ~ "/mdb2/init.sls" %} diff --git a/php/mdb2/pgsql.sls b/php/mdb2/pgsql.sls new file mode 100644 index 00000000..9ab08c9f --- /dev/null +++ b/php/mdb2/pgsql.sls @@ -0,0 +1,4 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mdb2-driver-pgsql' %} +{%- include tplroot ~ "/installed.jinja" %} +{%- include tplroot ~ "/mdb2/init.sls" %} diff --git a/php/memcache.sls b/php/memcache.sls index f96571de..5f1e56c9 100644 --- a/php/memcache.sls +++ b/php/memcache.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-memcache: - pkg.installed: - - name: {{ php.memcache_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'memcache' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/memcached.sls b/php/memcached.sls index a1d84cf4..d44f7745 100644 --- a/php/memcached.sls +++ b/php/memcached.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-memcached: - pkg.installed: - - name: {{ php.memcached_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'memcached' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/modules.sls b/php/modules.sls new file mode 100644 index 00000000..10f509f1 --- /dev/null +++ b/php/modules.sls @@ -0,0 +1,24 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} + +{%- set modules = salt['pillar.get']('php:modules') or [] %} +{%- set base_name = 'php.' %} +{%- set existing_states = salt['cp.list_states']() %} + +{%- set includes = [] %} +{%- set install = [] %} + +{%- for module in modules %} +{%- set state = base_name ~ module %} +{%- if state in existing_states %} +{%- do includes.append(state) %} +{%- else %} +{%- do install.append(module) %} +{%- endif %} +{%- endfor %} + +include: {{ includes|json }} + +{%- for state in install %} +{%- include tplroot ~ "/installed.jinja" %} +{%- endfor %} diff --git a/php/mongo.sls b/php/mongo.sls index defaac4d..decde099 100644 --- a/php/mongo.sls +++ b/php/mongo.sls @@ -1,43 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -{%- set version = salt['pillar.get']('php:mongo_version', none) %} - -include: - - php.deprecated - - php - - php.xml - - php.dev - - php.pear - -php-mongo: - pecl.installed: - - name: {{ php.mongo_pecl }} - - defaults: True -{%- if version is not none %} - - version: {{ version }} -{%- endif %} - - require: - - pkg: {{ php.pear_pkg }} - - pkg: build_pkgs - -build_pkgs: - pkg.installed: - - pkgs: {{ php.build_pkgs }} - -php-mongo-conf: - file.managed: - - name: {{ php.ext_conf_path }}/mongo.ini - - contents: | - extension={{ php.mongo_ext }} - - require: - - pkg: {{ php.php_pkg }} - -{%- if salt['grains.get']('os_family') == "Debian" %} - -php-mongo-enable: - cmd.run: - - name: {{ php.phpenmod_command }} mongo - - require: - - file: php-mongo-conf - -{%- endif %} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mongo' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/mongodb.sls b/php/mongodb.sls new file mode 100644 index 00000000..b8b67af3 --- /dev/null +++ b/php/mongodb.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mongodb' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/msgpack.sls b/php/msgpack.sls new file mode 100644 index 00000000..1b0ee6dc --- /dev/null +++ b/php/msgpack.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'msgpack' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/mysql.sls b/php/mysql.sls index c1170396..1e9bbc08 100644 --- a/php/mysql.sls +++ b/php/mysql.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mysql: - pkg.installed: - - name: {{ php.mysql_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mysql' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/mysqlnd.sls b/php/mysqlnd.sls index 20351b63..913f4f0d 100644 --- a/php/mysqlnd.sls +++ b/php/mysqlnd.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-mysqlnd: - pkg.installed: - - name: {{ php.mysqlnd_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'mysqlnd' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/net-smtp.sls b/php/net-smtp.sls new file mode 100644 index 00000000..4b770ca3 --- /dev/null +++ b/php/net-smtp.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'net-smtp' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/net4.sls b/php/net4.sls new file mode 100644 index 00000000..24c73c66 --- /dev/null +++ b/php/net4.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'net4' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/net6.sls b/php/net6.sls new file mode 100644 index 00000000..ba8fe4c5 --- /dev/null +++ b/php/net6.sls @@ -0,0 +1,10 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- if salt['grains.get']('os_family') == "RedHat" %} +{#- + Installation of this PEAR module can be done by running + `pear install Net_IPv6` on RedHat based distros +#} +{%- else %} + {%- set state = 'net6' %} + {%- include tplroot ~ "/installed.jinja" %} +{%- endif %} diff --git a/php/ng/adodb.sls b/php/ng/adodb.sls deleted file mode 100644 index 5561747a..00000000 --- a/php/ng/adodb.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'adodb' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/apache2/init.sls b/php/ng/apache2/init.sls deleted file mode 100644 index f7b94196..00000000 --- a/php/ng/apache2/init.sls +++ /dev/null @@ -1,14 +0,0 @@ -{% if grains['os_family'] in ["Debian", "FreeBSD"] %} -include: - - php.ng.deprecated - - php.ng.apache2.install -{% endif %} #END: os = Debian|FreeBSD -{% if grains['os_family'] == "Debian" %} - - php.ng.apache2.ini - -extend: - php_apache2_ini: - file: - - require: - - sls: php.ng.apache2.install -{% endif %} #END: os = debian diff --git a/php/ng/apache2/install.sls b/php/ng/apache2/install.sls deleted file mode 100644 index 51e1500a..00000000 --- a/php/ng/apache2/install.sls +++ /dev/null @@ -1,21 +0,0 @@ -{% from "php/ng/map.jinja" import php with context %} - -include: - - php.ng.deprecated - -{% set state = 'apache2' %} -{% include "php/ng/installed.jinja" %} - -{% if grains['os_family'] == "FreeBSD" %} -{{ php.lookup.apache2.module_config }}: - file.managed: - - source: salt://php/ng/apache2/files/mod_php.conf.jinja - - template: jinja -{% if salt['pillar.get']('php:ng:use_apache_formula', True) %} - - makedirs: true - - require_in: - - sls: apache - - watch_in: - - module: apache-restart -{% endif %} #END: use apache formula -{% endif %} #END: os = debian diff --git a/php/ng/apc.sls b/php/ng/apc.sls deleted file mode 100644 index d1c7f1ac..00000000 --- a/php/ng/apc.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'apc' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/apcu.sls b/php/ng/apcu.sls deleted file mode 100644 index 389c837c..00000000 --- a/php/ng/apcu.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'apcu' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/auth-sasl.sls b/php/ng/auth-sasl.sls deleted file mode 100644 index 98f8e559..00000000 --- a/php/ng/auth-sasl.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'auth-sasl' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/bcmath.sls b/php/ng/bcmath.sls deleted file mode 100644 index 14a2da6d..00000000 --- a/php/ng/bcmath.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'bcmath' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/bz2.sls b/php/ng/bz2.sls deleted file mode 100644 index be634c34..00000000 --- a/php/ng/bz2.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'bz2' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/cache-lite.sls b/php/ng/cache-lite.sls deleted file mode 100644 index 34783a94..00000000 --- a/php/ng/cache-lite.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'cache-lite' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/cgi.sls b/php/ng/cgi.sls deleted file mode 100644 index 655e92a9..00000000 --- a/php/ng/cgi.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'cgi' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/composer.sls b/php/ng/composer.sls deleted file mode 100644 index b5776e66..00000000 --- a/php/ng/composer.sls +++ /dev/null @@ -1,62 +0,0 @@ -{% from "php/ng/map.jinja" import php with context %} - -{% set install_file = php.lookup.pkgs.local_bin + '/' + php.lookup.pkgs.composer_bin %} - -{% if not salt['config.get']('sudo_user') %} - {% set salt_user = salt['config.get']('user', 'root') %} -{% else %} - {% set salt_user = salt['config.get']('sudo_user', 'root') %} -{% endif %} - -{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %} - -include: - - php.ng.deprecated - - php.ng -{% if grains['os_family'] == 'FreeBSD' %} - - php.ng.filter - - php.ng.hash - - php.ng.json - - php.ng.mbstring - - php.ng.openssl - - php.ng.phar -{% endif %} - -get-composer: - file.managed: - - name: {{ php.lookup.pkgs.temp_dir }}/installer - - mode: 0755 - - unless: test -f {{ install_file }} - - source: https://getcomposer.org/installer - - source_hash: https://composer.github.io/installer.sig - - require: - - pkg: php - -install-composer: - cmd.run: - - name: php {{ php.lookup.pkgs.temp_dir }}/installer --filename={{ php.lookup.pkgs.composer_bin }} --install-dir={{ php.lookup.pkgs.local_bin }} - - unless: test -f {{ install_file }} - - env: - - HOME: {{ salt_user_home }} - - require: - - file: get-composer - -# Get composer version date and check if older than 60day (defaultvalue of COMPOSER_DEV_WARNING_TIME) -# then it's time to run `composer selfupdate` -# -# It would be nice if composer had a command line switch to get this, but it doesn't, -# and so we just grep for it. -# -update-composer: - cmd.run: - - name: "{{ install_file }} selfupdate" -{% if grains['os_family'] == 'FreeBSD' %} - - unless: test $(date -v+60d -j -f "%Y-%m-%d %H:%M:%S" "$({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s") -{% else %} - - unless: test $(date -d "60 days $({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s") -{% endif %} - - cwd: {{ php.lookup.pkgs.local_bin }} - - env: - - HOME: {{ salt_user_home }} - - require: - - cmd: install-composer diff --git a/php/ng/console-table.sls b/php/ng/console-table.sls deleted file mode 100644 index 659ebdcd..00000000 --- a/php/ng/console-table.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'console-table' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/ctype.sls b/php/ng/ctype.sls deleted file mode 100644 index 97fc9104..00000000 --- a/php/ng/ctype.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'ctype' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/curl.sls b/php/ng/curl.sls deleted file mode 100644 index 6ad15ede..00000000 --- a/php/ng/curl.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'curl' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/dba.sls b/php/ng/dba.sls deleted file mode 100644 index 320dca6f..00000000 --- a/php/ng/dba.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'dba' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/dev.sls b/php/ng/dev.sls deleted file mode 100644 index 2ad11716..00000000 --- a/php/ng/dev.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'dev' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/dom.sls b/php/ng/dom.sls deleted file mode 100644 index 64b7add5..00000000 --- a/php/ng/dom.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'dom' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/fileinfo.sls b/php/ng/fileinfo.sls deleted file mode 100644 index 31567e09..00000000 --- a/php/ng/fileinfo.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'fileinfo' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/filter.sls b/php/ng/filter.sls deleted file mode 100644 index 46c155b9..00000000 --- a/php/ng/filter.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'filter' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/fpm/install.sls b/php/ng/fpm/install.sls deleted file mode 100644 index 72fa5c84..00000000 --- a/php/ng/fpm/install.sls +++ /dev/null @@ -1,5 +0,0 @@ -include: - - php.ng.deprecated - -{% set state = 'fpm' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/gd.sls b/php/ng/gd.sls deleted file mode 100644 index fe55c71a..00000000 --- a/php/ng/gd.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'gd' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/gearman.sls b/php/ng/gearman.sls deleted file mode 100644 index 1598d8ca..00000000 --- a/php/ng/gearman.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'gearman' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/geoip.sls b/php/ng/geoip.sls deleted file mode 100644 index 550b9a37..00000000 --- a/php/ng/geoip.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'geoip' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/geshi.sls b/php/ng/geshi.sls deleted file mode 100644 index 45888654..00000000 --- a/php/ng/geshi.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'geshi' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/gettext.sls b/php/ng/gettext.sls deleted file mode 100644 index 310b3ba2..00000000 --- a/php/ng/gettext.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'gettext' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/gmp.sls b/php/ng/gmp.sls deleted file mode 100644 index f9a7542e..00000000 --- a/php/ng/gmp.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'gmp' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/hash.sls b/php/ng/hash.sls deleted file mode 100644 index aabf7a66..00000000 --- a/php/ng/hash.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'hash' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/hhvm/config.sls b/php/ng/hhvm/config.sls deleted file mode 100644 index 4f242e55..00000000 --- a/php/ng/hhvm/config.sls +++ /dev/null @@ -1,19 +0,0 @@ -# Manages the php-hhvm main ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - -include: - - php.ng.deprecated - -{% 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) }} - diff --git a/php/ng/hhvm/install.sls b/php/ng/hhvm/install.sls deleted file mode 100644 index 65761eee..00000000 --- a/php/ng/hhvm/install.sls +++ /dev/null @@ -1,5 +0,0 @@ -include: - - php.ng.deprecated - -{% set state = 'hhvm' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/hhvm/service.sls b/php/ng/hhvm/service.sls deleted file mode 100644 index 458ad7c4..00000000 --- a/php/ng/hhvm/service.sls +++ /dev/null @@ -1,20 +0,0 @@ -# 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.deprecated - - 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 - diff --git a/php/ng/http.sls b/php/ng/http.sls deleted file mode 100644 index 5735eee0..00000000 --- a/php/ng/http.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'http' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/iconv.sls b/php/ng/iconv.sls deleted file mode 100644 index 75e68b94..00000000 --- a/php/ng/iconv.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'iconv' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/igbinary.sls b/php/ng/igbinary.sls deleted file mode 100644 index e1c980d4..00000000 --- a/php/ng/igbinary.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'igbinary' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/imagick.sls b/php/ng/imagick.sls deleted file mode 100644 index 7bfcd466..00000000 --- a/php/ng/imagick.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'imagick' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/imap.sls b/php/ng/imap.sls deleted file mode 100644 index 20b015e2..00000000 --- a/php/ng/imap.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'imap' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/init.sls b/php/ng/init.sls deleted file mode 100644 index 80bd5da4..00000000 --- a/php/ng/init.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'php' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/intl.sls b/php/ng/intl.sls deleted file mode 100644 index 2e85c2e7..00000000 --- a/php/ng/intl.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'intl' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/json.sls b/php/ng/json.sls deleted file mode 100644 index 1f9d6d80..00000000 --- a/php/ng/json.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'json' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/ldap.sls b/php/ng/ldap.sls deleted file mode 100644 index f75346db..00000000 --- a/php/ng/ldap.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'ldap' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mail.sls b/php/ng/mail.sls deleted file mode 100644 index 6193ef7d..00000000 --- a/php/ng/mail.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mail' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mbstring.sls b/php/ng/mbstring.sls deleted file mode 100644 index f8dcbcac..00000000 --- a/php/ng/mbstring.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mbstring' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mcrypt.sls b/php/ng/mcrypt.sls deleted file mode 100644 index e69fe131..00000000 --- a/php/ng/mcrypt.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mcrypt' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mdb2/init.sls b/php/ng/mdb2/init.sls deleted file mode 100644 index 138ace04..00000000 --- a/php/ng/mdb2/init.sls +++ /dev/null @@ -1,5 +0,0 @@ -include: - - php.ng.deprecated - -{% set state = 'mdb2' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mdb2/mysql.sls b/php/ng/mdb2/mysql.sls deleted file mode 100644 index 831515d7..00000000 --- a/php/ng/mdb2/mysql.sls +++ /dev/null @@ -1,6 +0,0 @@ -include: - - php.ng.deprecated - -{% set state = 'mdb2-driver-mysql' %} -{% include "php/ng/installed.jinja" %} -{% include "php/ng/mdb2/init.sls" %} diff --git a/php/ng/mdb2/pgsql.sls b/php/ng/mdb2/pgsql.sls deleted file mode 100644 index 9b9aba4a..00000000 --- a/php/ng/mdb2/pgsql.sls +++ /dev/null @@ -1,6 +0,0 @@ -include: - - php.ng.deprecated - -{% set state = 'mdb2-driver-pgsql' %} -{% include "php/ng/installed.jinja" %} -{% include "php/ng/mdb2/init.sls" %} diff --git a/php/ng/memcache.sls b/php/ng/memcache.sls deleted file mode 100644 index f1401026..00000000 --- a/php/ng/memcache.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'memcache' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/memcached.sls b/php/ng/memcached.sls deleted file mode 100644 index 9509c25d..00000000 --- a/php/ng/memcached.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'memcached' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/modules.sls b/php/ng/modules.sls deleted file mode 100644 index 56b20de0..00000000 --- a/php/ng/modules.sls +++ /dev/null @@ -1,23 +0,0 @@ -{% from "php/ng/map.jinja" import php with context %} - -{% set modules = salt['pillar.get']('php:ng:modules') or [] %} -{% set base_name = 'php.ng.' %} -{% set existing_states = salt['cp.list_states']() %} - -{% set includes = [] %} -{% set install = [] %} - -{% for module in modules %} -{% set state = base_name ~ module %} -{% if state in existing_states %} -{% do includes.append(state) %} -{% else %} -{% do install.append(module) %} -{% endif %} -{% endfor %} - -include: {{ includes|json }} - -{% for state in install %} -{% include "php/ng/installed.jinja" %} -{% endfor %} diff --git a/php/ng/mongo.sls b/php/ng/mongo.sls deleted file mode 100644 index 19048957..00000000 --- a/php/ng/mongo.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mongo' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mongodb.sls b/php/ng/mongodb.sls deleted file mode 100644 index 22ed84eb..00000000 --- a/php/ng/mongodb.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mongodb' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/msgpack.sls b/php/ng/msgpack.sls deleted file mode 100644 index ae99d55e..00000000 --- a/php/ng/msgpack.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'msgpack' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mysql.sls b/php/ng/mysql.sls deleted file mode 100644 index ad0cfe72..00000000 --- a/php/ng/mysql.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mysql' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/mysqlnd.sls b/php/ng/mysqlnd.sls deleted file mode 100644 index 844cc3e8..00000000 --- a/php/ng/mysqlnd.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'mysqlnd' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/net-smtp.sls b/php/ng/net-smtp.sls deleted file mode 100644 index 3a9a9707..00000000 --- a/php/ng/net-smtp.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'net-smtp' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/net4.sls b/php/ng/net4.sls deleted file mode 100644 index 99d250c9..00000000 --- a/php/ng/net4.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'net4' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/net6.sls b/php/ng/net6.sls deleted file mode 100644 index 78332f35..00000000 --- a/php/ng/net6.sls +++ /dev/null @@ -1,9 +0,0 @@ -{% if salt['grains.get']('os_family') == "RedHat" %} -{# - Installation of this PEAR module can be done by running - `pear install Net_IPv6` on RedHat based distros -#} -{% else %} - {% set state = 'net6' %} - {% include "php/ng/installed.jinja" %} -{% endif %} \ No newline at end of file diff --git a/php/ng/oauth.sls b/php/ng/oauth.sls deleted file mode 100644 index b1000741..00000000 --- a/php/ng/oauth.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'oauth' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/opcache.sls b/php/ng/opcache.sls deleted file mode 100644 index 73ed5063..00000000 --- a/php/ng/opcache.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'opcache' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/openssl.sls b/php/ng/openssl.sls deleted file mode 100644 index b37485b1..00000000 --- a/php/ng/openssl.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'openssl' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/pdo.sls b/php/ng/pdo.sls deleted file mode 100644 index 6d96b5cb..00000000 --- a/php/ng/pdo.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'pdo' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/pdo_mysql.sls b/php/ng/pdo_mysql.sls deleted file mode 100644 index c6e8fc46..00000000 --- a/php/ng/pdo_mysql.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'pdo_mysql' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/pear.sls b/php/ng/pear.sls deleted file mode 100644 index 560d25ad..00000000 --- a/php/ng/pear.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'pear' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/pgsql.sls b/php/ng/pgsql.sls deleted file mode 100644 index 859e1e9a..00000000 --- a/php/ng/pgsql.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'pgsql' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/phar.sls b/php/ng/phar.sls deleted file mode 100644 index 8a1b9aca..00000000 --- a/php/ng/phar.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'phar' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/posix.sls b/php/ng/posix.sls deleted file mode 100644 index 817eefee..00000000 --- a/php/ng/posix.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'posix' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/pspell.sls b/php/ng/pspell.sls deleted file mode 100644 index c42ec731..00000000 --- a/php/ng/pspell.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'pspell' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/readline.sls b/php/ng/readline.sls deleted file mode 100644 index cea79870..00000000 --- a/php/ng/readline.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'readline' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/redis.sls b/php/ng/redis.sls deleted file mode 100644 index 6afe4a37..00000000 --- a/php/ng/redis.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'redis' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/seclib.sls b/php/ng/seclib.sls deleted file mode 100644 index 9b803919..00000000 --- a/php/ng/seclib.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'seclib' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/session.sls b/php/ng/session.sls deleted file mode 100644 index d8c7c482..00000000 --- a/php/ng/session.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'session' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/simplexml.sls b/php/ng/simplexml.sls deleted file mode 100644 index 48068265..00000000 --- a/php/ng/simplexml.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'simplexml' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/snmp.sls b/php/ng/snmp.sls deleted file mode 100644 index 2c405c43..00000000 --- a/php/ng/snmp.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'snmp' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/soap.sls b/php/ng/soap.sls deleted file mode 100644 index 28f2344b..00000000 --- a/php/ng/soap.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'soap' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/sqlite.sls b/php/ng/sqlite.sls deleted file mode 100644 index ac788ebd..00000000 --- a/php/ng/sqlite.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'sqlite' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/ssh2.sls b/php/ng/ssh2.sls deleted file mode 100644 index 530857b8..00000000 --- a/php/ng/ssh2.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'ssh2' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/suhosin.sls b/php/ng/suhosin.sls deleted file mode 100644 index b4b9c2a3..00000000 --- a/php/ng/suhosin.sls +++ /dev/null @@ -1,90 +0,0 @@ -{% from "php/ng/map.jinja" import php with context %} - -include: - - php.ng.deprecated - - php.ng - - php.ng.dev - -{% set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %} - -{% if salt['grains.get']('os') == "Ubuntu" %} - {% if phpng_version >= '7.0' %} - {% set suhosin_ext = php.lookup.pkgs.suhosin7_ext %} - {% set suhosin_name = 'suhosin7' %} - {% set suhosin_repo = php.lookup.pkgs.suhosin7_repo %} - {% set tmppath = '/tmp/suhosin7' %} - {% else %} - {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} - {% set suhosin_name = 'suhosin' %} - {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} - {% set tmppath = '/tmp/suhosin5' %} - {% endif %} -{% elif salt['grains.get']('os_family') == "RedHat" %} - {% if grains['osmajorrelease'] == "7" %} - {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} - {% set suhosin_name = 'suhosin' %} - {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} - {% set tmppath = '/tmp/suhosin5' %} - {% else %} - {# RHEL version 6 contains PHP 5.3, which is not supported by Suhosin #} - {% endif %} -{% else %} - {% set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} - {% set suhosin_name = 'suhosin' %} - {% set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} - {% set tmppath = '/tmp/suhosin5' %} -{% endif %} - -build-pkgs: - pkg.installed: - - pkgs: {{ php.lookup.pkgs.build_pkgs }} - -git: - pkg.installed: [] - -suhosin-source: - git.latest: - - name: {{ suhosin_repo }} - - target: {{ tmppath }} - - unless: - - test -d {{ tmppath }} - - require: - - pkg: git - -install-suhosin: - cmd.run: - - name: | - phpize - ./configure - make - make install - - cwd: {{ tmppath }} - - shell: /bin/bash - - runas: root - - unless: - - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini - - require: - - pkg: build-pkgs - - git: suhosin-source - -php-suhosin-conf: - file.managed: - - name: {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini - - contents: | - extension={{ suhosin_ext }} - suhosin.executor.include.whitelist=phar - - require: - - pkg: php - - cmd: install-suhosin - - unless: - - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini - -{% if salt['grains.get']('os_family') == "Debian" %} - -php-suhosin-enable: - cmd.run: - - name: {{ php.lookup.pkgs.phpenmod_command }} {{ suhosin_name }} - - require: - - file: php-suhosin-conf - -{% endif %} diff --git a/php/ng/svn.sls b/php/ng/svn.sls deleted file mode 100644 index 17ff0f6f..00000000 --- a/php/ng/svn.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'svn' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/sybase.sls b/php/ng/sybase.sls deleted file mode 100644 index a7e24394..00000000 --- a/php/ng/sybase.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'sybase' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/tcpdf.sls b/php/ng/tcpdf.sls deleted file mode 100644 index 40af6393..00000000 --- a/php/ng/tcpdf.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'tcpdf' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/tidy.sls b/php/ng/tidy.sls deleted file mode 100644 index 530f4ada..00000000 --- a/php/ng/tidy.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'tidy' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/tokenizer.sls b/php/ng/tokenizer.sls deleted file mode 100644 index 060b5a15..00000000 --- a/php/ng/tokenizer.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'tokenizer' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/uuid.sls b/php/ng/uuid.sls deleted file mode 100644 index 8c27a6a9..00000000 --- a/php/ng/uuid.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'uuid' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/xcache/ini.sls b/php/ng/xcache/ini.sls deleted file mode 100644 index 46b65519..00000000 --- a/php/ng/xcache/ini.sls +++ /dev/null @@ -1,18 +0,0 @@ -# Manages the php cli main ini file -{% from "php/ng/map.jinja" import php with context %} -{% from "php/ng/ini.jinja" import php_ini %} - -include: - - php.ng.deprecated - -{% set settings = php.xcache.ini.defaults %} -{% for key, value in php.xcache.ini.settings.items() %} - {% 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) }} diff --git a/php/ng/xcache/install.sls b/php/ng/xcache/install.sls deleted file mode 100644 index 78caa756..00000000 --- a/php/ng/xcache/install.sls +++ /dev/null @@ -1,5 +0,0 @@ -include: - - php.ng.deprecated - -{% set state = 'xcache' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/xdebug.sls b/php/ng/xdebug.sls deleted file mode 100644 index 1abe04a4..00000000 --- a/php/ng/xdebug.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'xdebug' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/xml.sls b/php/ng/xml.sls deleted file mode 100644 index 70c974e0..00000000 --- a/php/ng/xml.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'xml' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/xmlwriter.sls b/php/ng/xmlwriter.sls deleted file mode 100644 index 8e6dddd4..00000000 --- a/php/ng/xmlwriter.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'xmlwriter' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/xsl.sls b/php/ng/xsl.sls deleted file mode 100644 index 9789f2d6..00000000 --- a/php/ng/xsl.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'xsl' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/ng/zip.sls b/php/ng/zip.sls deleted file mode 100644 index 1c5bd288..00000000 --- a/php/ng/zip.sls +++ /dev/null @@ -1,2 +0,0 @@ -{% set state = 'zip' %} -{% include "php/ng/installed.jinja" %} diff --git a/php/oauth.sls b/php/oauth.sls index e77abaad..5986375b 100644 --- a/php/oauth.sls +++ b/php/oauth.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-oauth: - pkg.installed: - - name: {{ php.oauth_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'oauth' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/opcache.sls b/php/opcache.sls new file mode 100644 index 00000000..458babfd --- /dev/null +++ b/php/opcache.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'opcache' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/openssl.sls b/php/openssl.sls new file mode 100644 index 00000000..5085aa18 --- /dev/null +++ b/php/openssl.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'openssl' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/pdo.sls b/php/pdo.sls new file mode 100644 index 00000000..95e11914 --- /dev/null +++ b/php/pdo.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'pdo' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/pdo_mysql.sls b/php/pdo_mysql.sls new file mode 100644 index 00000000..6ff6e30f --- /dev/null +++ b/php/pdo_mysql.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'pdo_mysql' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/pear.sls b/php/pear.sls index 1a6d9768..7ec8076f 100644 --- a/php/pear.sls +++ b/php/pear.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-pear: - pkg.installed: - - name : {{ php.pear_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'pear' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/pgsql.sls b/php/pgsql.sls index 70114eb7..c6cb8bdd 100644 --- a/php/pgsql.sls +++ b/php/pgsql.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-pgsql: - pkg.installed: - - name: {{ php.pgsql_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'pgsql' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/phar.sls b/php/phar.sls new file mode 100644 index 00000000..f6627306 --- /dev/null +++ b/php/phar.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'phar' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/posix.sls b/php/posix.sls new file mode 100644 index 00000000..8e70c57b --- /dev/null +++ b/php/posix.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'posix' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/pspell.sls b/php/pspell.sls new file mode 100644 index 00000000..be2be298 --- /dev/null +++ b/php/pspell.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'pspell' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/readline.sls b/php/readline.sls index 4fb8c788..71aedbce 100644 --- a/php/readline.sls +++ b/php/readline.sls @@ -1,10 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-readline: - pkg: - - installed - - name: {{ php.readline_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'readline' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/redis.sls b/php/redis.sls index b7a8f27c..2b3998fd 100644 --- a/php/redis.sls +++ b/php/redis.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-redis: - pkg.installed: - - name : {{ php.redis_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'redis' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/seclib.sls b/php/seclib.sls new file mode 100644 index 00000000..c1754824 --- /dev/null +++ b/php/seclib.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'seclib' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/session.sls b/php/session.sls new file mode 100644 index 00000000..5dffe66b --- /dev/null +++ b/php/session.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'session' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/simplexml.sls b/php/simplexml.sls new file mode 100644 index 00000000..eddfa16e --- /dev/null +++ b/php/simplexml.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'simplexml' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/snmp.sls b/php/snmp.sls new file mode 100644 index 00000000..88b68991 --- /dev/null +++ b/php/snmp.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'snmp' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/soap.sls b/php/soap.sls index 89acf0d3..df67dd52 100644 --- a/php/soap.sls +++ b/php/soap.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-soap: - pkg.installed: - - name : {{ php.soap_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'soap' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/sqlite.sls b/php/sqlite.sls index 758c4688..450f4ef4 100644 --- a/php/sqlite.sls +++ b/php/sqlite.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-sqlite: - pkg.installed: - - name: {{ php.sqlite_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'sqlite' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/ssh2.sls b/php/ssh2.sls new file mode 100644 index 00000000..a3158ff0 --- /dev/null +++ b/php/ssh2.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'ssh2' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/suhosin.sls b/php/suhosin.sls index a1682c30..45fc3a14 100644 --- a/php/suhosin.sls +++ b/php/suhosin.sls @@ -1,43 +1,41 @@ -{%- from "php/map.jinja" import php with context %} +{%- set tplroot = tpldir.split('/')[0] %} +{%- from "/map.jinja" import php, php_version with context %} include: - - php.deprecated - php - php.dev -{%- set php_version = salt['pillar.get']('php:version', '7.0')|string %} - {%- if salt['grains.get']('os') == "Ubuntu" %} {%- if php_version >= '7.0' %} - {%- set suhosin_ext = php.suhosin7_ext %} + {%- set suhosin_ext = php.lookup.pkgs.suhosin7_ext %} {%- set suhosin_name = 'suhosin7' %} - {%- set suhosin_repo = php.suhosin7_repo %} + {%- set suhosin_repo = php.lookup.pkgs.suhosin7_repo %} {%- set tmppath = '/tmp/suhosin7' %} {%- else %} - {%- set suhosin_ext = php.suhosin5_ext %} + {%- set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} {%- set suhosin_name = 'suhosin' %} - {%- set suhosin_repo = php.suhosin5_repo %} + {%- set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} {%- set tmppath = '/tmp/suhosin5' %} {%- endif %} {%- elif salt['grains.get']('os_family') == "RedHat" %} {%- if grains['osmajorrelease'] == "7" %} - {%- set suhosin_ext = php.suhosin5_ext %} + {%- set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} {%- set suhosin_name = 'suhosin' %} - {%- set suhosin_repo = php.suhosin5_repo %} + {%- set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} {%- set tmppath = '/tmp/suhosin5' %} {%- else %} {# RHEL version 6 contains PHP 5.3, which is not supported by Suhosin #} {%- endif %} {%- else %} - {%- set suhosin_ext = php.suhosin5_ext %} + {%- set suhosin_ext = php.lookup.pkgs.suhosin5_ext %} {%- set suhosin_name = 'suhosin' %} - {%- set suhosin_repo = php.suhosin5_repo %} + {%- set suhosin_repo = php.lookup.pkgs.suhosin5_repo %} {%- set tmppath = '/tmp/suhosin5' %} {%- endif %} build-pkgs: pkg.installed: - - pkgs: {{ php.build_pkgs }} + - pkgs: {{ php.lookup.pkgs.build_pkgs }} git: pkg.installed: [] @@ -62,29 +60,29 @@ install-suhosin: - shell: /bin/bash - runas: root - unless: - - test -e {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini - require: - pkg: build-pkgs - git: suhosin-source php-suhosin-conf: file.managed: - - name: {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - name: {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini - contents: | extension={{ suhosin_ext }} suhosin.executor.include.whitelist=phar - require: - - pkg: {{ php.php_pkg }} + - pkg: php - cmd: install-suhosin - unless: - - test -e {{ php.ext_conf_path }}/{{ suhosin_name }}.ini + - test -e {{ php.lookup.pkgs.ext_conf_path }}/{{ suhosin_name }}.ini -{%- if salt['grains.get']('os_family') == "Debian" %} +{% if salt['grains.get']('os_family') == "Debian" %} php-suhosin-enable: cmd.run: - - name: {{ php.phpenmod_command }} {{ suhosin_name }} + - name: {{ php.lookup.pkgs.phpenmod_command }} {{ suhosin_name }} - require: - file: php-suhosin-conf -{%- endif %} +{% endif %} diff --git a/php/svn.sls b/php/svn.sls new file mode 100644 index 00000000..de8d19d3 --- /dev/null +++ b/php/svn.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'svn' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/sybase.sls b/php/sybase.sls index a114b0b8..0dd4e6d8 100644 --- a/php/sybase.sls +++ b/php/sybase.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-sybase: - pkg.installed: - - name: {{ php.sybase_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'sybase' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/tcpdf.sls b/php/tcpdf.sls new file mode 100644 index 00000000..00ced3e9 --- /dev/null +++ b/php/tcpdf.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'tcpdf' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/tidy.sls b/php/tidy.sls new file mode 100644 index 00000000..69697c79 --- /dev/null +++ b/php/tidy.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'tidy' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/tokenizer.sls b/php/tokenizer.sls new file mode 100644 index 00000000..516006b1 --- /dev/null +++ b/php/tokenizer.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'tokenizer' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/uuid.sls b/php/uuid.sls new file mode 100644 index 00000000..8942d392 --- /dev/null +++ b/php/uuid.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'uuid' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/xcache/ini.sls b/php/xcache/ini.sls new file mode 100644 index 00000000..7e45fce5 --- /dev/null +++ b/php/xcache/ini.sls @@ -0,0 +1,16 @@ +# Manages the php cli main ini file +{%- set tplroot = tpldir.split('/')[0] %} +{%- from tplroot ~ "/map.jinja" import php with context %} +{%- from tplroot ~ "/ini.jinja" import php_ini %} + +{%- set settings = php.xcache.ini.defaults %} +{%- for key, value in php.xcache.ini.settings.items() %} + {%- 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) }} diff --git a/php/ng/xcache/init.sls b/php/xcache/init.sls similarity index 53% rename from php/ng/xcache/init.sls rename to php/xcache/init.sls index 2214246c..1a3dbd1c 100644 --- a/php/ng/xcache/init.sls +++ b/php/xcache/init.sls @@ -1,12 +1,11 @@ # Installs php-xcache and manages the associated xcache.ini include: - - php.ng.deprecated - - php.ng.xcache.install - - php.ng.xcache.ini + - php.xcache.install + - php.xcache.ini extend: php_xcache_ini: file: - require: - - sls: php.ng.xcache.install + - sls: php.xcache.install diff --git a/php/xcache/install.sls b/php/xcache/install.sls new file mode 100644 index 00000000..7df54cbe --- /dev/null +++ b/php/xcache/install.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'xcache' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/xdebug.sls b/php/xdebug.sls new file mode 100644 index 00000000..3ffaa847 --- /dev/null +++ b/php/xdebug.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'xdebug' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/xml.sls b/php/xml.sls index 80ed33a7..5f4d1650 100644 --- a/php/xml.sls +++ b/php/xml.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-xml: - pkg.installed: - - name: {{ php.xml_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'xml' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/xmlwriter.sls b/php/xmlwriter.sls new file mode 100644 index 00000000..cc895bd6 --- /dev/null +++ b/php/xmlwriter.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'xmlwriter' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/xsl.sls b/php/xsl.sls new file mode 100644 index 00000000..3ec2d226 --- /dev/null +++ b/php/xsl.sls @@ -0,0 +1,3 @@ +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'xsl' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/php/zip.sls b/php/zip.sls index 49c0fd16..7986d143 100644 --- a/php/zip.sls +++ b/php/zip.sls @@ -1,9 +1,3 @@ -{%- from "php/map.jinja" import php with context %} - -include: - - php.deprecated - - php - -php-zip: - pkg.installed: - - name: {{ php.zip_pkg }} +{%- set tplroot = tpldir.split('/')[0] %} +{%- set state = 'zip' %} +{%- include tplroot ~ "/installed.jinja" %} diff --git a/pillar.example b/pillar.example index c9f21ceb..5820a8ac 100644 --- a/pillar.example +++ b/pillar.example @@ -1,4 +1,4 @@ -## php.ng pillar examples +## php pillar examples php: # Use the following values to mute deprecation warnings @@ -12,197 +12,197 @@ php: external_repo_name: 'ondrej/php' # Use Software Collections Repository offering PHP 5.4, 5.5, 5.6, 7.0 and 7.1 # https://www.softwarecollections.org/en/ for more information. - # SCL is only supported on RHEL and CentOS and only active when using php.ng + # SCL is only supported on RHEL and CentOS use_scl_repo: True # Which PHP version from the SCL repos to use scl_php_version: 71 # Set the MongoDB driver version. You can specify (optionally) the driver version # when you add the php.mongo formula to your execution list mongo_version: "1.5.5" - ng: - # set the version of php to be used - version: "7.3" - # can be a list of versions : - # version: - # - "7.3" - # - "7.2" - - # set the version for the Debian alternatives system, when using a list of versions, - # php:ng:version is used otherwise. - alternatives_version: "7.3" - - # this section contains mostly grain filtered data, while overrides - # are possible in the pillar for unique cases, if your OS is not - # represented, please consider adding it to the map.jinja for - # upstream inclusion - lookup: - enable_php_repo: centos-sclo-rh-testing - # package definitions, these can be strings, lists of strings, or - # lists of dictionaries - pkgs: - memcached: php5-memcached - # ensures both will be installed - curl: - - php-common - - curl - # a dictionary can be used in more complex cases where you want - # to pass forward special arguments to the pkg.installed call - # you MUST include the name argument for this to work - cli: - - - name: php-cli - fromrepo: my-specialrepo - - - name: php-common - skip_verify: True - - # php-fpm os-specific settings - fpm: - conf: /location/of/php-fpm/config.conf - ini: /location/of/php-fpm/php.ini - pools: /location/of/php-fpm/pool.d - service: name-of-php5-fpm-service - - # the default content of the php5-fpm main config file - defaults: - global: - pid: /var/run/php5-fpm.pid - - # php-cli os-specific settings + # set the version of php to be used + version: "7.3" + # can be a list of versions : + # version: + # - "7.3" + # - "7.2" + + # set the version for the Debian alternatives system, when using a list of versions, + # php:version is used otherwise. + alternatives_version: "7.3" + + # this section contains mostly grain filtered data, while overrides + # are possible in the pillar for unique cases, if your OS is not + # represented, please consider adding it to the map.jinja for + # upstream inclusion + lookup: + enable_php_repo: centos-sclo-rh-testing + # package definitions, these can be strings, lists of strings, or + # lists of dictionaries + pkgs: + memcached: php5-memcached + # ensures both will be installed + curl: + - php-common + - curl + # a dictionary can be used in more complex cases where you want + # to pass forward special arguments to the pkg.installed call + # you MUST include the name argument for this to work + # php-cli os-specific settings cli: - ini: /location/of/php-cli/php.ini - - # php-fpm settings + - + name: php-cli + fromrepo: my-specialrepo + - + name: php-common + skip_verify: True + + # php-fpm os-specific settings fpm: + conf: /location/of/php-fpm/config.conf + ini: /location/of/php-fpm/php.ini + pools: /location/of/php-fpm/pool.d + service: name-of-php5-fpm-service - # settings for the php-fpm service - service: - # if True, enables the php-fpm service, if False disables it - enabled: True - # additional arguments passed forward to - # service.enabled/disabled - opts: - reload: True - - # settings for the relevant php-fpm configuration files - config: - - # options to manage the php.ini file used by php-fpm - ini: - # arguments passed through to file.managed - opts: - recurse: True - # php.ini file contents that will be merged with the - # defaults in php.ng.ini.defaults. See php.ng.ini.defaults for - # syntax guidelines. - settings: - PHP: - engine: 'Off' - extension_dir: '/usr/lib/php/modules/' - extension: [pdo_mysql.so, iconv.so, openssl.so] - - # options to manage the php-fpm conf file - conf: - # arguments passed through to file.managed - opts: - recurse: True - # php-fpm conf file contents that will be merged with - # php.ng.lookup.fpm.defaults. See php.ng.ini.defaults for - # ini-style syntax guidelines. - settings: - global: - pid: /var/run/php-fpm/special-pid.file - - # settings for fpm-pools - pools: - # defaults will apply for each pools settings and can be overwritten by pool settings - defaults: - user: nginx - group: nginx - listen: /var/run/php-fpm-default.sock - - # name of the pool file to be managed, this will be appended - # to the path specified in php.ng.lookup.fpm.pools - 'mypool.conf': - # If true, the pool file will be managed, if False it will be - # absent - enabled: True - - # Overwrite the filename for ext_pillar that doesn't allow - # dots in fields names. - filname: my_other_name.conf - - # arguments passed forward to file.managed or file.absent - opts: - replace: False - - # pool file contents. See php.ng.ini.defaults for ini-style - # syntax guidelines. - settings: - myapp: - user: www-data - group: www-data - listen: /var/run/php5-fpm-myapp.sock - listen.owner: www-data - listen.group: www-data - listen.mode: 0660 - pm: dynamic - pm.max_children: 5 - pm.start_servers: 2 - pm.min_spare_servers: 1 - pm.max_spare_servers: 3 - 'php_admin_value[memory_limit]': 300M - - # php-cli settings + # the default content of the php5-fpm main config file + defaults: + global: + pid: /var/run/php5-fpm.pid + + # php-cli os-specific settings cli: - # settings to manage the cli's php.ini + ini: /location/of/php-cli/php.ini + + # php-fpm settings + fpm: + + # settings for the php-fpm service + service: + # if True, enables the php-fpm service, if False disables it + enabled: True + # additional arguments passed forward to + # service.enabled/disabled + opts: + reload: True + + # settings for the relevant php-fpm configuration files + config: + + # options to manage the php.ini file used by php-fpm ini: - # opts passed forward directly to file.managed + # arguments passed through to file.managed opts: - replace: False - # contents of the php.ini file that are merged with defaults - # from php.ng.ini.defaults. See php.ng.ini.defaults for ini-style - # syntax guidelines + recurse: True + # php.ini file contents that will be merged with the + # defaults in php.ini.defaults. See php.ini.defaults for + # syntax guidelines. settings: PHP: engine: 'Off' + extension_dir: '/usr/lib/php/modules/' + extension: [pdo_mysql.so, iconv.so, openssl.so] - # php-xcache settings - xcache: - ini: - opts: {} - # contents of the xcache.ini file that are merged with defaults - # from php.xcache.ini.defaults. See php.ng.ini.defaults for ini-style + # options to manage the php-fpm conf file + conf: + # arguments passed through to file.managed + opts: + recurse: True + # php-fpm conf file contents that will be merged with + # php.lookup.fpm.defaults. See php.ini.defaults for + # ini-style syntax guidelines. settings: - xcache: - xcache.size: 90M + global: + pid: /var/run/php-fpm/special-pid.file - # global php.ini settings - ini: - # Default php.ini contents. These follow a strict format. The top- - # level dict keys form ini group headings. Nested key/value - # pairs represent setting=value statements. If a value is a list, - # its contents will be joined by commas in final rendering. + # settings for fpm-pools + pools: + # defaults will apply for each pools settings and can be overwritten by pool settings defaults: + user: nginx + group: nginx + listen: /var/run/php-fpm-default.sock + + # name of the pool file to be managed, this will be appended + # to the path specified in php.lookup.fpm.pools + 'mypool.conf': + # If true, the pool file will be managed, if False it will be + # absent + enabled: True + + # Overwrite the filename for ext_pillar that doesn't allow + # dots in fields names. + filname: my_other_name.conf + + # arguments passed forward to file.managed or file.absent + opts: + replace: False + + # pool file contents. See php.ini.defaults for ini-style + # syntax guidelines. + settings: + myapp: + user: www-data + group: www-data + listen: /var/run/php5-fpm-myapp.sock + listen.owner: www-data + listen.group: www-data + listen.mode: 0660 + pm: dynamic + pm.max_children: 5 + pm.start_servers: 2 + pm.min_spare_servers: 1 + pm.max_spare_servers: 3 + 'php_admin_value[memory_limit]': 300M + + # php-cli settings + cli: + # settings to manage the cli's php.ini + ini: + # opts passed forward directly to file.managed + opts: + replace: False + # contents of the php.ini file that are merged with defaults + # from php.ini.defaults. See php.ini.defaults for ini-style + # syntax guidelines + settings: PHP: - engine: on - output_buffering: 4096 - disable_functions: - - pcntl_alarm - - pcntl_fork - - pcntl_wait - 'CLI Server': - cli_server_color: 'On' - - # List of modules to install via php.ng.modules - modules: - # Calls `php.ng.` if available, or try to install the matching - # packages that can be set via from php:ng:lookup:pkgs - - cli - - fpm - - curl - - mysql - - # When using php.ng.apache2 on FreeBSD: - # Set this to False if you're not using apache-formula - use_apache_formula: True + engine: 'Off' + + # php-xcache settings + xcache: + ini: + opts: {} + # contents of the xcache.ini file that are merged with defaults + # from php.xcache.ini.defaults. See php.ini.defaults for ini-style + settings: + xcache: + xcache.size: 90M + + # global php.ini settings + ini: + # Default php.ini contents. These follow a strict format. The top- + # level dict keys form ini group headings. Nested key/value + # pairs represent setting=value statements. If a value is a list, + # its contents will be joined by commas in final rendering. + defaults: + PHP: + engine: on + output_buffering: 4096 + disable_functions: + - pcntl_alarm + - pcntl_fork + - pcntl_wait + 'CLI Server': + cli_server_color: 'On' + + # List of modules to install via php.modules + modules: + # Calls `php.` if available, or try to install the matching + # packages that can be set via from php:lookup:pkgs + - cli + - fpm + - curl + - mysql + + # When using php.apache2 on FreeBSD: + # Set this to False if you're not using apache-formula + use_apache_formula: True