php-formula
Formula to set up and configure php
WARNING: BREAKING CHANGES SINCE v1.0.0 |
---|
Prior to
v1.0.0,
this formula provided two methods for managing PHP; the old method under
If you are not in a position to migrate, please pin your repo to the final release tag before v1.0.0, i.e. v0.40.1. To migrate from To migrate from the old |
1. General notes
See the full SaltStack Formulas installation and usage instructions.
If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.
If you want to use this formula, please pay attention to the FORMULA
file and/or git tag
, which contains the currently released version.
This formula is versioned according to Semantic
Versioning.
See Formula Versioning Section for more details.
2. Contributing to this repo
Commit message formatting is significant!!
Please see How to contribute for more details.
3. Available states
Please provide feedback by filing issues, discussing in #salt
in
Freenode and the mailing list as normal.
Note: php states require the merge parameter of salt.modules.pillar.get(), first available in the Helium release.
3.3. php.apache2
Meta-state that combines php.apache2.install and php.apache2.ini.
3.13. php.cli
Meta-state that combines php.cli.install and php.cli.ini.
3.16. php.composer
Installs [composer](https://getcomposer.org) and keeps it updated.
3.19. 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.
3.26. php.fpm.pools
Meta-state that combines php.fpm.service and php.fpm.pools_config
3.54. php.memcache
Installs the php-memcache package. Disabled on opensuse need server:php:extensions repo
3.55. php.memcached
Installs the php-memcached package. Disabled on opensuse need server:php:extensions repo
3.56. php.modules
Calls php.<name>
for each entry in php:modules
if available, or try
to install the matching packages that can be set via from
php:lookup:pkgs
3.73. php.redis
Installs the php-redis package. Disabled on opensuse need server:php:extensions repo
3.86. php.xcache
Meta-state that combines php.xcache.install and php.xcache.ini.
4. Testing
Linux testing is done with kitchen-salt
.
4.1. Requirements
-
Ruby
-
Docker
$ gem install bundler
$ bundle install
$ bin/kitchen test [platform]
Where [platform]
is the platform name defined in kitchen.yml
, e.g.
debian-9-2019-2-py3
.
4.2. bin/kitchen converge
Creates the docker instance and runs the php
main states, ready for
testing.
5. Testing with Vagrant
Windows/FreeBSD/OpenBSD testing is done with kitchen-salt
.
5.2. Setup
$ gem install bundler
$ bundle install --with=vagrant
$ bin/kitchen test [platform]
Where [platform]
is the platform name defined in
kitchen.vagrant.yml
, e.g. windows-81-latest-py3
.
5.3. Note
When testing using Vagrant you must set the environment variable
KITCHEN_LOCAL_YAML
to kitchen.vagrant.yml
. For example:
$ KITCHEN_LOCAL_YAML=kitchen.vagrant.yml bin/kitchen test # Alternatively,
$ export KITCHEN_LOCAL_YAML=kitchen.vagrant.yml
$ bin/kitchen test
Then run the following commands as needed.
5.4. bin/kitchen converge
Creates the Vagrant instance and runs the php
main states, ready for
testing.