removed php_7_stretch

This commit is contained in:
ts
2019-01-22 16:02:38 +00:00
parent 959df009e1
commit 6830f906dc
94 changed files with 0 additions and 9175 deletions

View File

@@ -1,366 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.
## [v6.0.1](https://github.com/voxpupuli/puppet-php/tree/v6.0.1) (2018-10-07)
[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v6.0.0...v6.0.1)
**Fixed bugs:**
- Fix enable extension when there is no module associated [\#479](https://github.com/voxpupuli/puppet-php/pull/479) ([amateo](https://github.com/amateo))
- Remove config when module is ensured to absent [\#478](https://github.com/voxpupuli/puppet-php/pull/478) ([amateo](https://github.com/amateo))
**Closed issues:**
- "php::manage\_repos: true" causes failure on Ubuntu 18.04, needs newer puppetlabs-apt version\(\>=5.0.0\) [\#467](https://github.com/voxpupuli/puppet-php/issues/467)
**Merged pull requests:**
- modulesync 2.1.0 and allow puppet 6.x [\#481](https://github.com/voxpupuli/puppet-php/pull/481) ([bastelfreak](https://github.com/bastelfreak))
- Add acceptance tests for system php with extensions [\#476](https://github.com/voxpupuli/puppet-php/pull/476) ([bastelfreak](https://github.com/bastelfreak))
- Allow puppetlabs/stdlib 5.x and puppetlabs/apt 6.x [\#472](https://github.com/voxpupuli/puppet-php/pull/472) ([bastelfreak](https://github.com/bastelfreak))
## [v6.0.0](https://github.com/voxpupuli/puppet-php/tree/v6.0.0) (2018-07-29)
[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v5.3.0...v6.0.0)
**Breaking changes:**
- Tests failing under debian8 [\#433](https://github.com/voxpupuli/puppet-php/issues/433)
- fixed hiera merge bug [\#435](https://github.com/voxpupuli/puppet-php/pull/435) ([c33s](https://github.com/c33s))
**Implemented enhancements:**
- Compatibility with Software collections \(SCL\) [\#451](https://github.com/voxpupuli/puppet-php/pull/451) ([oranenj](https://github.com/oranenj))
- Add Debian 9 support [\#440](https://github.com/voxpupuli/puppet-php/pull/440) ([SimonHoenscheid](https://github.com/SimonHoenscheid))
- Add initial ubuntu 18.04 support [\#428](https://github.com/voxpupuli/puppet-php/pull/428) ([jkroepke](https://github.com/jkroepke))
**Fixed bugs:**
- php.ini not updated [\#422](https://github.com/voxpupuli/puppet-php/issues/422)
- Error: Could not upgrade module 'puppet-php' \(v4.0.0 -\> v5.0.0\) [\#378](https://github.com/voxpupuli/puppet-php/issues/378)
- Fix paths for phpunit on FreeBSD [\#291](https://github.com/voxpupuli/puppet-php/pull/291) ([bitnexus](https://github.com/bitnexus))
**Closed issues:**
- Debian 9 \(Stretch\) support [\#439](https://github.com/voxpupuli/puppet-php/issues/439)
- Repository class switch failing on Ubuntu [\#392](https://github.com/voxpupuli/puppet-php/issues/392)
- Next stable release? [\#352](https://github.com/voxpupuli/puppet-php/issues/352)
- PHP extensions loaded twice [\#341](https://github.com/voxpupuli/puppet-php/issues/341)
- PECL/Extension checks for beta packages [\#73](https://github.com/voxpupuli/puppet-php/issues/73)
**Merged pull requests:**
- Update README.md with working RHSCL example. [\#463](https://github.com/voxpupuli/puppet-php/pull/463) ([Tamerz](https://github.com/Tamerz))
- enable ubuntu 18.04 acceptance tests [\#462](https://github.com/voxpupuli/puppet-php/pull/462) ([bastelfreak](https://github.com/bastelfreak))
- drop EOL OSs; fix puppet version range [\#453](https://github.com/voxpupuli/puppet-php/pull/453) ([bastelfreak](https://github.com/bastelfreak))
- Rely on beaker-hostgenerator for docker nodesets [\#452](https://github.com/voxpupuli/puppet-php/pull/452) ([ekohl](https://github.com/ekohl))
- mark private classes with assert\_private\(\) [\#447](https://github.com/voxpupuli/puppet-php/pull/447) ([bastelfreak](https://github.com/bastelfreak))
- migrate vars from topscope to relative scope [\#444](https://github.com/voxpupuli/puppet-php/pull/444) ([bastelfreak](https://github.com/bastelfreak))
- bump puppet to latest supported version 4.10.0 [\#443](https://github.com/voxpupuli/puppet-php/pull/443) ([bastelfreak](https://github.com/bastelfreak))
- Update puppet/archive dependency [\#438](https://github.com/voxpupuli/puppet-php/pull/438) ([marknl](https://github.com/marknl))
- switch the dotdeb repo url to https [\#431](https://github.com/voxpupuli/puppet-php/pull/431) ([bastelfreak](https://github.com/bastelfreak))
## [v5.3.0](https://github.com/voxpupuli/puppet-php/tree/v5.3.0) (2018-03-06)
[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v5.2.0...v5.3.0)
**Implemented enhancements:**
- mark Ubuntu 16.04 as supported and fix its tests [\#221](https://github.com/voxpupuli/puppet-php/issues/221)
- Using the new facts hash instead of the global var in repo/debian.pp [\#425](https://github.com/voxpupuli/puppet-php/pull/425) ([c33s](https://github.com/c33s))
- Add Acceptance tests [\#414](https://github.com/voxpupuli/puppet-php/pull/414) ([bastelfreak](https://github.com/bastelfreak))
**Fixed bugs:**
- Fix Archlinux support [\#423](https://github.com/voxpupuli/puppet-php/pull/423) ([bastelfreak](https://github.com/bastelfreak))
- Fix wrongly named parameters for apt::source/key [\#420](https://github.com/voxpupuli/puppet-php/pull/420) ([bitcrush](https://github.com/bitcrush))
- manage software-properties-common on ubuntu [\#419](https://github.com/voxpupuli/puppet-php/pull/419) ([bastelfreak](https://github.com/bastelfreak))
**Merged pull requests:**
- add examples for php-fpm/nginx [\#424](https://github.com/voxpupuli/puppet-php/pull/424) ([bastelfreak](https://github.com/bastelfreak))
- add tests for php5.6 [\#418](https://github.com/voxpupuli/puppet-php/pull/418) ([bastelfreak](https://github.com/bastelfreak))
## [v5.2.0](https://github.com/voxpupuli/puppet-php/tree/v5.2.0) (2018-02-14)
[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v5.1.0...v5.2.0)
**Implemented enhancements:**
- add ubuntu 16.04 support [\#412](https://github.com/voxpupuli/puppet-php/pull/412) ([bastelfreak](https://github.com/bastelfreak))
- Add PHP 7.1 support on Debian [\#293](https://github.com/voxpupuli/puppet-php/pull/293) ([fstr](https://github.com/fstr))
**Fixed bugs:**
- Auto\_update not idempotent [\#402](https://github.com/voxpupuli/puppet-php/issues/402)
- use correct require arguments [\#415](https://github.com/voxpupuli/puppet-php/pull/415) ([bastelfreak](https://github.com/bastelfreak))
- fix composer auto\_update idempotency in case no update is available [\#408](https://github.com/voxpupuli/puppet-php/pull/408) ([joekohlsdorf](https://github.com/joekohlsdorf))
- Fixing wrong pear package name in Amazon Linux [\#399](https://github.com/voxpupuli/puppet-php/pull/399) ([gdurandvadas](https://github.com/gdurandvadas))
**Closed issues:**
- Upgrade to work with Puppet5 [\#406](https://github.com/voxpupuli/puppet-php/issues/406)
- php 7.2 + ubuntu 16.04 - pdo-mysql extension not installing correctly [\#405](https://github.com/voxpupuli/puppet-php/issues/405)
- config\_root parameter does nothing on RHEL7 [\#397](https://github.com/voxpupuli/puppet-php/issues/397)
**Merged pull requests:**
- Deprecate hiera\_hash functions [\#410](https://github.com/voxpupuli/puppet-php/pull/410) ([minorOffense](https://github.com/minorOffense))
- mark Puppet 5 as supported [\#407](https://github.com/voxpupuli/puppet-php/pull/407) ([joekohlsdorf](https://github.com/joekohlsdorf))
- Change default RedHat params to use config\_root [\#398](https://github.com/voxpupuli/puppet-php/pull/398) ([DALUofM](https://github.com/DALUofM))
## [v5.1.0](https://github.com/voxpupuli/puppet-php/tree/v5.1.0) (2017-11-10)
[Full Changelog](https://github.com/voxpupuli/puppet-php/compare/v5.0.0...v5.1.0)
**Fixed bugs:**
- Fix syntax issues with data types [\#385](https://github.com/voxpupuli/puppet-php/pull/385) ([craigwatson](https://github.com/craigwatson))
- fix ubuntu 17.04 version for php7 [\#383](https://github.com/voxpupuli/puppet-php/pull/383) ([arudat](https://github.com/arudat))
- Fix OS fact comparison for Ubuntu 12 and 14 [\#375](https://github.com/voxpupuli/puppet-php/pull/375) ([dbeckham](https://github.com/dbeckham))
- Fix OS facts usage when selecting repo class for Ubuntu systems [\#374](https://github.com/voxpupuli/puppet-php/pull/374) ([dbeckham](https://github.com/dbeckham))
- Confine pecl provider to where pear command is available [\#364](https://github.com/voxpupuli/puppet-php/pull/364) ([walkamongus](https://github.com/walkamongus))
- fix default value of php::fpm::pool::access\_log\_format [\#361](https://github.com/voxpupuli/puppet-php/pull/361) ([lesinigo](https://github.com/lesinigo))
**Closed issues:**
- Debian repository classes are being selected on Ubuntu systems [\#373](https://github.com/voxpupuli/puppet-php/issues/373)
- Changes in \#357 break Ubuntu version dependent resources [\#372](https://github.com/voxpupuli/puppet-php/issues/372)
**Merged pull requests:**
- Proposed fix for failing parallel spec tests [\#386](https://github.com/voxpupuli/puppet-php/pull/386) ([wyardley](https://github.com/wyardley))
- update dependencies in metadata [\#379](https://github.com/voxpupuli/puppet-php/pull/379) ([mmoll](https://github.com/mmoll))
- Bump metadata.json version to 5.0.1-rc [\#377](https://github.com/voxpupuli/puppet-php/pull/377) ([dhollinger](https://github.com/dhollinger))
- bump dep on puppet/archive to '\< 3.0.0' [\#376](https://github.com/voxpupuli/puppet-php/pull/376) ([costela](https://github.com/costela))
- Add missing php-fpm user and group class param docs [\#346](https://github.com/voxpupuli/puppet-php/pull/346) ([dbeckham](https://github.com/dbeckham))
## [v5.0.0](https://github.com/voxpupuli/puppet-php/tree/v5.0.0) (2017-08-07)
### Summary
This backwards-incompatible release drops puppet 3, PHP 5.5 on Ubuntu, and the deprecated `php::extension` parameter `pecl_source`. It improves much of the internal code quality, and adds several useful features the most interesting of which is probably the `php::extension` parameter `ini_prefix`.
### Changed
- Drop puppet 3 compatibility.
- Bumped puppetlabs-apt lower bound to 4.1.0
- Bumped puppetlabs-stdlib lower bound to 4.13.1
### Removed
- Deprecated `php::extension` define parameters `pecl_source`. Use `source` instead.
- PHP 5.5 support on ubuntu.
### Added
- `php` class parameters `fpm_user` and `fpm_group` to customize php-fpm user/group.
- `php::fpm` class parameters `user` and `group`.
- `php::fpm::pool` define parameter `pm_process_idle_timeout` and pool.conf `pm.process_idle_timeout` directive.
- `php::extension` class parameters `ini_prefix` and `install_options`.
- Archlinux compatibility.
- Bumped puppetlabs-apt upper bound to 5.0.0
### Fixed
- Replaced validate functions with data types.
- Linting issues.
- Replace legacy facts with facts hash.
- Simplify `php::extension`
- Only apt dependency when `manage_repos => true`
- No more example42/yum dependency
## 2017-02-11 Release [4.0.0]
This is the last release with Puppet3 support!
* Fix a bug turning `manage_repos` off on wheezy
* Fix a deprecation warning on `apt::key` when using `manage_repos` on wheezy (#110). This change requires puppetlabs/apt at >= 1.8.0
* Allow removal of config values (#124)
* Add `phpversion` fact, for querying through PuppetDB or Foreman (#119)
* Allow configuring the fpm pid file (#123)
* Add embedded SAPI support (#115)
* Add options to fpm config and pool configs (#139)
* Add parameter logic for PHP 7 on Ubuntu/Debian (#180)
* add SLES PHP 7.0 Support (#220)
* allow packaged extensions to be loaded as zend extensions
* Fix command to enable php extensions (#226)
* Fix many rucocop warnings
* Update module Ubuntu 14.04 default to official repository setup
* Fix dependency for extentions with no package source
* Allow packaged extensions to be loaded as Zend extensions
* Support using an http proxy for downloading composer
* Refactor classes php::fpm and php::fpm:service
* Manage apache/PHP configurations on Debian and RHEL systems
* use voxpupuli/archive to download composer
* respect $manage_repos, do not include ::apt if set to false
* Bump min version_requirement for Puppet + deps
* allow pipe param for pecl extensions
* Fix: composer auto_update: exec's environment must be array
### Breaking Changes
* Deep merge `php::extensions` the same way as `php::settings`. This technically is a
breaking change but should not affect many people.
* PHP 5.6 is the default version on all systems now (except Ubuntu 16.04, where 7.0 is the default).
* There's a php::globals class now, where global paramters (like the PHP version) are set. (#132)
* Removal of php::repo::ubuntu::ppa (#218)
## 3.4.2
* Fix a bug that changed the default of `php::manage_repos` to `false` on
Debian-based operating systems except wheezy. It should be turned on by
default. (#116)
* Fix a bug that prevented reloading php-fpm on Ubuntu in some cases.
(#117, #107)
## 3.4.1
* Fix reloading php-fpm on Ubuntu trusty & utopic (#107)
## 3.4.0
* New parameter `ppa` for class `php::repo::ubuntu` to specify the ppa
name to use. We default to `ondrej/php5-oldstable` for precise and
`ondrej/php5` otherwise.
* New parameter `include` for `php::fpm::pool` resources to specify
custom configuration files.
## 3.3.1
* Make `systemd_interval` parameter for class `php::fpm::config` optional
## 3.3.0
* `php::extension` resources:
* New boolean parameter `settings_prefix` to automatically prefix all
settings keys with the extensions names. Defaults to false to ensurre
the current behaviour.
* New string parameter `so_name` to set the DSO name of an extension if
it doesn't match the package name.
* New string parameter `php_api_version` to set a custom api version. If
not `undef`, the `so_name` is prefixed with the full module path in the
ini file. Defaults to `undef`.
* The default of the parameter `listen_allowed_clients` of `php::fpm::pool`
resources is now `undef` instead of `'127.0.0.1'`. This way it is more
intuitive to change the default tcp listening socket at `127.0.0.1:9000`
to a unix socket by only setting the `listen` parameter instead of
additionally needing to unset `listen_allowed_clients`. This has no
security implications.
* New parameters for the `php::fpm::config` class:
* `error_log`
* `syslog_facility`
* `syslog_ident`
* `systemd_interval`
* A bug that prevented merging the global `php::settings` parameter into
SAPI configs for `php::cli` and `php::fpm` was fixed.
* The dotdeb repos are now only installed for Debian wheezy as Debian jessie
has a sufficiently recent PHP version.
## 3.2.2
* Fix a typo in hiera keys `php::settings` & `php::fpm::settings` (#83)
## 3.2.1
* Fixed default `yum_repo` key in `php::repo::redhat`
* On Ubuntu precise we now use the ondrej/php5-oldstable ppa. This can be
manually enabled with by setting `$php::repo::ubuntu::oldstable` to
`true`.
* `$php::ensure` now defaults to `present` instead of `latest`. Though,
strictly speaking, this represents a functional change, we consider this
to be a bugfix because automatic updates should be enabled explicitely.
* `$php::ensure` is not anymore passed to `php::extension` resources as
default ensure parameter because this doesn't make sense.
## 3.2.0
* Support for FreeBSD added by Frank Wall
* RedHat now uses remi-php56 yum repo by default
* The resource `php::fpm::pool` is now public, you can use it in your
manifests without using `$php::fpm::pools`
* We now have autogenerated documentation using `puppetlabs/strings`
## 3.1.0
* New parameter `pool_purge` for `php::extension` to remove files not
managed by puppet from the pool directory.
* The `pecl_source` parameter for `php::extension` was renamend to
`source` because it is also useful for PEAR extensions.
`pecl_source` can still be used but is deprecated and will be
removed in the next major release.
* Parameters referring to time in `php::fpm::config` can now be
specified with units (i.e. `'60s'`, `'1d'`):
* `emergency_restart_threshold`
* `emergency_restart_interval`
* `process_control_timeout`
* The PEAR version is not independant of `$php::ensure` and can be
configured with `$php::pear_ensure`
* Give special thanks to the contributors of this release:
* Petr Sedlacek
* Sherlan Moriah
## 3.0.1
* Fix typo in package suffix for php-fpm on RHEL in params.pp
## 3.0.0
* Removes `$php::fpm::pool::error_log`. Use the `php_admin_flag` and
`php_admin_value` parameters to set the php settings `log_errors` and
`error_log` instead.
* Removes support for PHP 5.3 on Debian-based systems. See the notes in the
README for more information.
* Removes the `php_version` fact which had only worked on the later puppet runs.
* Moves CLI-package handling to `php::packages`
* Allows changing the package prefix via `php::package_prefix`.
* Moves FPM-package handling from `php::fpm::package` to `php::fpm`
* Changes `php::packages`, so that `php::packages::packages` becomes
`php::packages::names` and are installed and `php::packages::names_to_prefix`
are installed prefixed by `php::package_prefix`.
* PHPUnit is now installed as phar in the same way composer is installed,
causing all parameters to change
* The `php::extension` resource has a new parameter: `zend`. If set to true,
exenstions that were installed with pecl are loaded with `zend_extension`.
## 2.0.4
* Style fixes all over the place
* Module dependencies are now bound to the current major version
## 2.0.3
* Some issues & bugs with extensions were fixed
* If you set the `provider` parameter of an extension to `"none"`, no
extension packages will be installed
* The EPEL yum repo has been added for RedHat systems
## 2.0.2
* Adds support for `header_packages` on all extensions
* Adds `install_options` to pear package provider
## 2.0.1
* This is a pure bug fix release
* Fix for CVE 2014-0185 (https://bugs.php.net/bug.php?id=67060)
## 2.0.0
* Remove augeas and switch to puppetlabs/inifile for configs
* Old: `settings => [set PHP/short_open_tag On]`
* New: `settings => {PHP/short_open_tag => On}`
* Settings parmeter cleanups
* The parameter `config` of `php::extension` resources is now called `settings`
* The parameters `user` and `group` of `php::fpm` have been moved to `php::fpm::config`
* New parameter `php::settings` for global settings (i.e. CLI & FPM)
* New parameter `php::cli` to disable CLI if supported
## 1.1.2
* SLES: PHP 5.5 will now be installed
* Pecl extensions now autoload the .so based on $name instead of $title
## 1.1.1
* some nasty bugs with the pecl php::extension provider were fixed
* php::extension now has a new pecl_source parameter for specifying custom
source channels for the pecl provider
## 1.1.0
* add phpunit to main class
* fix variable access for augeas
## 1.0.2
* use correct suse apache service name
* fix anchoring of augeas
## 1.0.1
* fixes #9 undefined pool_base_dir
## 1.0.0
Initial release
[4.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v4.0.0...v4.1.0
[4.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v3.4.2...v4.0.0
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

View File

@@ -1,82 +0,0 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"
def location_for(place, fake_version = nil)
if place =~ /^(git[:@][^#]*)#(.*)/
[fake_version, { :git => $1, :branch => $2, :require => false }].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place, { :require => false }]
end
end
group :test do
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
gem 'mocha', '~> 1.4.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'parallel_tests', :require => false
end
group :development do
gem 'travis', :require => false
gem 'travis-lint', :require => false
gem 'guard-rake', :require => false
gem 'overcommit', '>= 0.39.1', :require => false
end
group :system_tests do
gem 'winrm', :require => false
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
gem 'beaker', '>= 3.9.0', :require => false
end
if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION']
gem 'beaker-rspec', *location_for(beaker_rspec_version)
else
gem 'beaker-rspec', :require => false
end
gem 'serverspec', :require => false
gem 'beaker-hostgenerator', '>= 1.1.10', :require => false
gem 'beaker-docker', :require => false
gem 'beaker-puppet', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6'
gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
gem 'bcrypt_pbkdf', :require => false
end
group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '>= 1.0', :require => false
end
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion.to_s, :require => false, :groups => [:test]
else
gem 'facter', :require => false, :groups => [:test]
end
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim: syntax=ruby

View File

@@ -1,222 +0,0 @@
## [v5.0.0](https://github.com/voxpupuli/puppet-php/tree/v5.0.0) (2017-08-07)
### Summary
This backwards-incompatible release drops puppet 3, PHP 5.5 on Ubuntu, and the deprecated `php::extension` parameter `pecl_source`. It improves much of the internal code quality, and adds several useful features the most interesting of which is probably the `php::extension` parameter `ini_prefix`.
### Changed
- Drop puppet 3 compatibility.
- Bumped puppetlabs-apt lower bound to 4.1.0
- Bumped puppetlabs-stdlib lower bound to 4.13.1
### Removed
- Deprecated `php::extension` define parameters `pecl_source`. Use `source` instead.
- PHP 5.5 support on ubuntu.
### Added
- `php` class parameters `fpm_user` and `fpm_group` to customize php-fpm user/group.
- `php::fpm` class parameters `user` and `group`.
- `php::fpm::pool` define parameter `pm_process_idle_timeout` and pool.conf `pm.process_idle_timeout` directive.
- `php::extension` class parameters `ini_prefix` and `install_options`.
- Archlinux compatibility.
- Bumped puppetlabs-apt upper bound to 5.0.0
### Fixed
- Replaced validate functions with data types.
- Linting issues.
- Replace legacy facts with facts hash.
- Simplify `php::extension`
- Only apt dependency when `manage_repos => true`
- No more example42/yum dependency
## 2017-02-11 Release [4.0.0]
This is the last release with Puppet3 support!
* Fix a bug turning `manage_repos` off on wheezy
* Fix a deprecation warning on `apt::key` when using `manage_repos` on wheezy (#110). This change requires puppetlabs/apt at >= 1.8.0
* Allow removal of config values (#124)
* Add `phpversion` fact, for querying through PuppetDB or Foreman (#119)
* Allow configuring the fpm pid file (#123)
* Add embedded SAPI support (#115)
* Add options to fpm config and pool configs (#139)
* Add parameter logic for PHP 7 on Ubuntu/Debian (#180)
* add SLES PHP 7.0 Support (#220)
* allow packaged extensions to be loaded as zend extensions
* Fix command to enable php extensions (#226)
* Fix many rucocop warnings
* Update module Ubuntu 14.04 default to official repository setup
* Fix dependency for extentions with no package source
* Allow packaged extensions to be loaded as Zend extensions
* Support using an http proxy for downloading composer
* Refactor classes php::fpm and php::fpm:service
* Manage apache/PHP configurations on Debian and RHEL systems
* use voxpupuli/archive to download composer
* respect $manage_repos, do not include ::apt if set to false
* Bump min version_requirement for Puppet + deps
* allow pipe param for pecl extensions
* Fix: composer auto_update: exec's environment must be array
### Breaking Changes
* Deep merge `php::extensions` the same way as `php::settings`. This technically is a
breaking change but should not affect many people.
* PHP 5.6 is the default version on all systems now (except Ubuntu 16.04, where 7.0 is the default).
* There's a php::globals class now, where global paramters (like the PHP version) are set. (#132)
* Removal of php::repo::ubuntu::ppa (#218)
## 3.4.2
* Fix a bug that changed the default of `php::manage_repos` to `false` on
Debian-based operating systems except wheezy. It should be turned on by
default. (#116)
* Fix a bug that prevented reloading php-fpm on Ubuntu in some cases.
(#117, #107)
## 3.4.1
* Fix reloading php-fpm on Ubuntu trusty & utopic (#107)
## 3.4.0
* New parameter `ppa` for class `php::repo::ubuntu` to specify the ppa
name to use. We default to `ondrej/php5-oldstable` for precise and
`ondrej/php5` otherwise.
* New parameter `include` for `php::fpm::pool` resources to specify
custom configuration files.
## 3.3.1
* Make `systemd_interval` parameter for class `php::fpm::config` optional
## 3.3.0
* `php::extension` resources:
* New boolean parameter `settings_prefix` to automatically prefix all
settings keys with the extensions names. Defaults to false to ensurre
the current behaviour.
* New string parameter `so_name` to set the DSO name of an extension if
it doesn't match the package name.
* New string parameter `php_api_version` to set a custom api version. If
not `undef`, the `so_name` is prefixed with the full module path in the
ini file. Defaults to `undef`.
* The default of the parameter `listen_allowed_clients` of `php::fpm::pool`
resources is now `undef` instead of `'127.0.0.1'`. This way it is more
intuitive to change the default tcp listening socket at `127.0.0.1:9000`
to a unix socket by only setting the `listen` parameter instead of
additionally needing to unset `listen_allowed_clients`. This has no
security implications.
* New parameters for the `php::fpm::config` class:
* `error_log`
* `syslog_facility`
* `syslog_ident`
* `systemd_interval`
* A bug that prevented merging the global `php::settings` parameter into
SAPI configs for `php::cli` and `php::fpm` was fixed.
* The dotdeb repos are now only installed for Debian wheezy as Debian jessie
has a sufficiently recent PHP version.
## 3.2.2
* Fix a typo in hiera keys `php::settings` & `php::fpm::settings` (#83)
## 3.2.1
* Fixed default `yum_repo` key in `php::repo::redhat`
* On Ubuntu precise we now use the ondrej/php5-oldstable ppa. This can be
manually enabled with by setting `$php::repo::ubuntu::oldstable` to
`true`.
* `$php::ensure` now defaults to `present` instead of `latest`. Though,
strictly speaking, this represents a functional change, we consider this
to be a bugfix because automatic updates should be enabled explicitely.
* `$php::ensure` is not anymore passed to `php::extension` resources as
default ensure parameter because this doesn't make sense.
## 3.2.0
* Support for FreeBSD added by Frank Wall
* RedHat now uses remi-php56 yum repo by default
* The resource `php::fpm::pool` is now public, you can use it in your
manifests without using `$php::fpm::pools`
* We now have autogenerated documentation using `puppetlabs/strings`
## 3.1.0
* New parameter `pool_purge` for `php::extension` to remove files not
managed by puppet from the pool directory.
* The `pecl_source` parameter for `php::extension` was renamend to
`source` because it is also useful for PEAR extensions.
`pecl_source` can still be used but is deprecated and will be
removed in the next major release.
* Parameters referring to time in `php::fpm::config` can now be
specified with units (i.e. `'60s'`, `'1d'`):
* `emergency_restart_threshold`
* `emergency_restart_interval`
* `process_control_timeout`
* The PEAR version is not independant of `$php::ensure` and can be
configured with `$php::pear_ensure`
* Give special thanks to the contributors of this release:
* Petr Sedlacek
* Sherlan Moriah
## 3.0.1
* Fix typo in package suffix for php-fpm on RHEL in params.pp
## 3.0.0
* Removes `$php::fpm::pool::error_log`. Use the `php_admin_flag` and
`php_admin_value` parameters to set the php settings `log_errors` and
`error_log` instead.
* Removes support for PHP 5.3 on Debian-based systems. See the notes in the
README for more information.
* Removes the `php_version` fact which had only worked on the later puppet runs.
* Moves CLI-package handling to `php::packages`
* Allows changing the package prefix via `php::package_prefix`.
* Moves FPM-package handling from `php::fpm::package` to `php::fpm`
* Changes `php::packages`, so that `php::packages::packages` becomes
`php::packages::names` and are installed and `php::packages::names_to_prefix`
are installed prefixed by `php::package_prefix`.
* PHPUnit is now installed as phar in the same way composer is installed,
causing all parameters to change
* The `php::extension` resource has a new parameter: `zend`. If set to true,
exenstions that were installed with pecl are loaded with `zend_extension`.
## 2.0.4
* Style fixes all over the place
* Module dependencies are now bound to the current major version
## 2.0.3
* Some issues & bugs with extensions were fixed
* If you set the `provider` parameter of an extension to `"none"`, no
extension packages will be installed
* The EPEL yum repo has been added for RedHat systems
## 2.0.2
* Adds support for `header_packages` on all extensions
* Adds `install_options` to pear package provider
## 2.0.1
* This is a pure bug fix release
* Fix for CVE 2014-0185 (https://bugs.php.net/bug.php?id=67060)
## 2.0.0
* Remove augeas and switch to puppetlabs/inifile for configs
* Old: `settings => [set PHP/short_open_tag On]`
* New: `settings => {PHP/short_open_tag => On}`
* Settings parmeter cleanups
* The parameter `config` of `php::extension` resources is now called `settings`
* The parameters `user` and `group` of `php::fpm` have been moved to `php::fpm::config`
* New parameter `php::settings` for global settings (i.e. CLI & FPM)
* New parameter `php::cli` to disable CLI if supported
## 1.1.2
* SLES: PHP 5.5 will now be installed
* Pecl extensions now autoload the .so based on $name instead of $title
## 1.1.1
* some nasty bugs with the pecl php::extension provider were fixed
* php::extension now has a new pecl_source parameter for specifying custom
source channels for the pecl provider
## 1.1.0
* add phpunit to main class
* fix variable access for augeas
## 1.0.2
* use correct suse apache service name
* fix anchoring of augeas
## 1.0.1
* fixes #9 undefined pool_base_dir
## 1.0.0
Initial release
[4.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v4.0.0...v4.1.0
[4.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v3.4.2...v4.0.0

View File

@@ -1,23 +0,0 @@
The MIT License (MIT)
Copyright (c) 2012-2013 Christian "Jippi" Winther <jippignu@gmail.com>
Tobias Nyholm <tobias@happyrecruiting.se>
2014-2015 Mayflower GmbH <devops@mayflower.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,453 +0,0 @@
[![Puppet Forge](http://img.shields.io/puppetforge/v/puppet/php.svg)](https://forge.puppetlabs.com/puppet/php)
[![Build Status](https://travis-ci.org/voxpupuli/puppet-php.svg?branch=master)](https://travis-ci.org/voxpupuli/puppet-php)
## Current Status
As the original creators of `puppet-php` are no longer maintaining the module, it has been handed over into the care of Vox Pupuli.
Please be sure to update all your links to the new location.
# voxpupuli/php Puppet Module
voxpupuli/php is a Puppet module for managing PHP with a strong focus
on php-fpm. The module aims to use sane defaults for the supported
architectures. We strive to support all recent versions of Debian,
Ubuntu, RedHat/CentOS, openSUSE/SLES and FreeBSD. Managing Apache
with `mod_php` is not supported.
This originally was a fork of [jippi/puppet-php](https://github.com/jippi/puppet-php)
(nodes-php on Puppet Forge) but has since been rewritten in large parts.
## Usage
Quickest way to get started is simply `include`'ing the _`php` class_.
```puppet
include '::php'
```
Or, you can override defaults and specify additional custom
configurations by declaring `class { '::php': }` with parameters:
```puppet
class { '::php':
ensure => latest,
manage_repos => true,
fpm => true,
dev => true,
composer => true,
pear => true,
phpunit => false,
}
```
Optionally the PHP version or configuration root directory can be changed also:
```puppet
class { '::php::globals':
php_version => '7.0',
config_root => '/etc/php/7.0',
}->
class { '::php':
manage_repos => true
}
```
There are more configuration options available. Please refer to the
auto-generated documentation at http://php.puppet.mayflower.de/.
### Defining `php.ini` settings
PHP configuration parameters in `php.ini` files can be defined as parameter
`settings` on the main `php` class, or `php::fpm` / `php::cli` classes,
or `php::extension` resources for each component independently.
These settings are written into their respective `php.ini` file. Global
settings in `php::settings` are merged with the settings of all components.
Please note that settings of extensions are always independent.
In the following example the PHP options and timezone will be set in
all PHP configurations, i.e. the PHP cli application and all php-fpm pools.
```puppet
class { '::php':
settings => {
'PHP/max_execution_time' => '90',
'PHP/max_input_time' => '300',
'PHP/memory_limit' => '64M',
'PHP/post_max_size' => '32M',
'PHP/upload_max_filesize' => '32M',
'Date/date.timezone' => 'Europe/Berlin',
},
}
```
### Installing extensions
PHP configuration parameters in `php.ini` files can be defined
as parameter `extensions` on the main `php` class. They are
activated for all activated SAPIs.
```puppet
class { '::php':
extensions => {
bcmath => { },
imagick => {
provider => pecl,
},
xmlrpc => { },
memcached => {
provider => 'pecl',
header_packages => [ 'libmemcached-devel', ],
},
apc => {
provider => 'pecl',
settings => {
'apc/stat' => '1',
'apc/stat_ctime' => '1',
},
sapi => 'fpm',
},
},
}
```
See [the documentation](http://php.puppet.mayflower.de/php/extension.html)
of the `php::extension` resource for all available parameters and default
values.
### Defining php-fpm pools
If different php-fpm pools are required, you can use `php::fpm::pool`
defined resource type. A single pool called `www` will be configured
by default. Specify additional pools like so:
```puppet
php::fpm::pool { 'www2':
listen => '127.0.1.1:9000',
}
```
For an overview of all possible parameters for `php::fpm::pool` resources
please see [its documention](http://php.puppet.mayflower.de/php/fpm/pool.html).
### Overriding php-fpm user
By default, php-fpm is set up to run as Apache. If you need to customize that user, you can do that like so:
```puppet
class { '::php':
fpm_user => 'nginx',
fpm_group => 'nginx',
}
```
### PHP with one FPM pool per user
This will create one vhost. $users is an array of people having php files at
$fqdn/$user. This codesnipped uses voxpupuli/php and voxpupuli/nginx to create
the vhost and one php fpm pool per user. This was tested on Archlinux with
nginx 1.13 and PHP 7.2.3.
```puppet
$users = ['bob', 'alice']
class { 'php':
ensure => 'present',
manage_repos => false,
fpm => true,
dev => false,
composer => false,
pear => true,
phpunit => false,
fpm_pools => {},
}
include nginx
nginx::resource::server{$facts['fqdn']:
www_root => '/var/www',
autoindex => 'on',
}
nginx::resource::location{'dontexportprivatedata':
server => $facts['fqdn'],
location => '~ /\.',
location_deny => ['all'],
}
$users.each |$user| {
# create one fpm pool. will be owned by the specific user
# fpm socket will be owned by the nginx user 'http'
php::fpm::pool{$user:
user => $user,
group => $user,
listen_owner => 'http',
listen_group => 'http',
listen_mode => '0660',
listen => "/var/run/php-fpm/${user}-fpm.sock",
}
nginx::resource::location { "${name}_root":
ensure => 'present',
server => $facts['fqdn'],
location => "~ .*${user}\/.*\.php$",
index_files => ['index.php'],
fastcgi => "unix:/var/run/php-fpm/${user}-fpm.sock",
include => ['fastcgi.conf'],
}
}
```
### Alternative examples using Hiera
Alternative to the Puppet DSL code examples above, you may optionally define your PHP configuration using Hiera.
Below are all the examples you see above, but defined in YAML format for use with Hiera.
```yaml
---
php::ensure: latest
php::manage_repos: true
php::fpm: true
php::fpm_user: 'nginx'
php::fpm_group: 'nginx'
php::dev: true
php::composer: true
php::pear: true
php::phpunit: false
php::settings:
'PHP/max_execution_time': '90'
'PHP/max_input_time': '300'
'PHP/memory_limit': '64M'
'PHP/post_max_size': '32M'
'PHP/upload_max_filesize': '32M'
'Date/date.timezone': 'Europe/Berlin'
php::extensions:
bcmath: {}
xmlrpc: {}
imagick:
provider: pecl
memcached:
provider: pecl
header_packages:
- libmemcached-dev
apc:
provider: pecl
settings:
'apc/stat': 1
'apc/stat_ctime': 1
sapi: 'fpm'
php::fpm::pools:
www2:
listen: '127.0.1.1:9000'
```
## Notes
### Debian squeeze & Ubuntu precise come with PHP 5.3
On Debian-based systems, we use `php5enmod` to enable extension-specific
configuration. This script is only present in `php5` packages beginning with
version 5.4. Furthermore, PHP 5.3 is not supported by upstream anymore.
We strongly suggest you use a recent PHP version, even if you're using an
older though still supported distribution release. Our default is to have
`php::manage_repos` enabled to add apt sources for
[Dotdeb](http://www.dotdeb.org/) on Debian and
[ppa:ondrej/php5](https://launchpad.net/~ondrej/+archive/ubuntu/php5/) on
Ubuntu with packages for the current stable PHP version closely tracking
upstream.
### Ubuntu systems and Ondřej's PPA
The older Ubuntu PPAs run by Ondřej have been deprecated (ondrej/php5, ondrej/php5.6)
in favor of a new PPA: ondrej/php which contains all 3 versions of PHP: 5.5, 5.6, and 7.0
Here's an example in hiera of getting PHP 5.6 installed with php-fpm, pear/pecl, and composer:
```puppet
php::globals::php_version: '5.6'
php::fpm: true
php::dev: true
php::composer: true
php::pear: true
php::phpunit: false
```
If you do not specify a php version, in Ubuntu the default will be 7.0 if you are
running Xenial (16.04), otherwise PHP 5.6 will be installed (for other versions)
### Apache support
Apache with `mod_php` is not supported by this module. Please use
[puppetlabs/apache](https://forge.puppetlabs.com/puppetlabs/apache) instead.
We prefer using php-fpm. You can find an example Apache vhost in
`manifests/apache_vhost.pp` that shows you how to use `mod_proxy_fcgi` to
connect to php-fpm.
### RedHat/CentOS SCL Users
If you plan to use the SCL repositories with this module you must do the following adjustments:
#### General config
This ensures that the module will create configurations in the directory ``/etc/opt/rh/<php_version>/` (also in php.d/
for extensions). Anyway you have to manage the SCL repo's by your own.
```puppet
class { '::php::globals':
php_version => 'rh-php71',
rhscl_mode => 'rhscl',
}
-> class { '::php':
manage_repos => false
}
```
#### Extensions
Extensions in SCL are being installed with packages that cover 1 or more .so files. This is kinda incompatible with
this module, since this module specifies an extension by name and derives the name of the package and the config (.ini)
from it. To manage extensions of SCL packages you must use the following parameters:
```puppet
class { '::php':
...
extensions => {
'soap' => {
ini_prefix => '20-',
},
}
}
```
By this you tell the module to configure bz2 and calender while ensuring only the package `common`. Additionally to the
installation of 'common' the inifiles 'calender.ini' and 'bz2.ini' will be created by the scheme
`<config_file_prefix><extension_title>`.
A list of commonly used modules:
```puppet
{
extensions => {
'xml' => {
ini_prefix => '20-',
multifile_settings => true,
settings => {
'dom' => {},
'simplexml' => {},
'xmlwriter' => {},
'xsl' => {},
'wddx' => {},
'xmlreader' => {},
},
},
'soap' => {
ini_prefix => '20-',
},
'imap' => {
ini_prefix => '20-',
},
'intl' => {
ini_prefix => '20-',
},
'gd' => {
ini_prefix => '20-',
},
'mbstring' => {
ini_prefix => '20-',
},
'xmlrpc' => {
ini_prefix => '20-',
},
'pdo' => {
ini_prefix => '20-',
multifile_settings => true,
settings => {
'pdo' => {},
'pdo_sqlite' => {},
'sqlite3' => {},
},
},
'process' => {
ini_prefix => '20-',
multifile_settings => true,
settings => {
'posix' => {},
'shmop' => {},
'sysvmsg' => {},
'sysvsem' => {},
'sysvshm' => {},
},
},
'mysqlnd' => {
ini_prefix => '30-',
multifile_settings => true,
settings => {
'mysqlnd' => {},
'mysql' => {},
'mysqli' => {},
'pdo_mysql' => {},
'sysvshm' => {},
},
},
'mysqlnd' => {
ini_prefix => '30-',
multifile_settings => true,
settings => {
'mysqlnd' => {},
'mysql' => {},
'mysqli' => {},
'pdo_mysql' => {},
'sysvshm' => {},
},
},
}
}
```
### Facts
We deliver a `phpversion` fact with this module. This is explicitly **NOT** intended
to be used within your puppet manifests as it will only work on your second puppet
run. Its intention is to make querying PHP versions per server easy via PuppetDB or Foreman.
### FreeBSD support
On FreeBSD systems we purge the system-wide `extensions.ini` in favour of
per-module configuration files.
Please also note that support for Composer and PHPUnit on FreeBSD is untested
and thus likely incomplete.
### Running the test suite
To run the tests install the ruby dependencies with `bundler` and execute
`rake`:
```
bundle install --path vendor/bundle
bundle exec rake
```
## Bugs & New Features
If you happen to stumble upon a bug, please feel free to create a pull request
with a fix (optionally with a test), and a description of the bug and how it
was resolved.
Or if you're not into coding, simply create an issue adding steps to let us
reproduce the bug and we will happily fix it.
If you have a good idea for a feature or how to improve this module in general,
please create an issue to discuss it. We are very open to feedback. Pull
requests are always welcome.
We hate orphaned and unmaintained Puppet modules as much as you do and
therefore promise that we will continue to maintain this module and keep
response times to issues short. If we happen to lose interest, we will write
a big fat warning into this README to let you know.
## License
The project is released under the permissive MIT license.
The source can be found at
[github.com/voxpupuli/puppet-php](https://github.com/voxpupuli/puppet-php/).
This Puppet module was originally maintained by some fellow puppeteers at
[Mayflower GmbH](https://mayflower.de) and is now maintained by
[Vox Pupuli](https://voxpupuli.org/).

View File

@@ -1,92 +0,0 @@
require 'puppetlabs_spec_helper/rake_tasks'
# load optional tasks for releases
# only available if gem group releases is installed
begin
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks'
rescue LoadError
end
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
exclude_paths = %w(
pkg/**/*
vendor/**/*
.vendor/**/*
spec/**/*
)
PuppetLint.configuration.ignore_paths = exclude_paths
PuppetSyntax.exclude_paths = exclude_paths
desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
PuppetLint.configuration.fix = true
Rake::Task[:lint].invoke
end
desc 'Run acceptance tests'
RSpec::Core::RakeTask.new(:acceptance) do |t|
t.pattern = 'spec/acceptance'
end
desc 'Run tests metadata_lint, release_checks'
task test: [
:metadata_lint,
:release_checks,
]
desc "Run main 'test' task and report merged results to coveralls"
task test_with_coveralls: [:test] do
if Dir.exist?(File.expand_path('../lib', __FILE__))
require 'coveralls/rake/task'
Coveralls::RakeTask.new
Rake::Task['coveralls:push'].invoke
else
puts 'Skipping reporting to coveralls. Module has no lib dir'
end
end
desc "Print supported beaker sets"
task 'beaker_sets', [:directory] do |t, args|
directory = args[:directory]
metadata = JSON.load(File.read('metadata.json'))
(metadata['operatingsystem_support'] || []).each do |os|
(os['operatingsystemrelease'] || []).each do |release|
if directory
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
else
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
end
filename = "spec/acceptance/nodesets/#{beaker_set}.yml"
puts beaker_set if File.exists? filename
end
end
end
begin
require 'github_changelog_generator/task'
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
version = (Blacksmith::Modulefile.new).version
config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/
config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
config.user = 'voxpupuli'
metadata_json = File.join(File.dirname(__FILE__), 'metadata.json')
metadata = JSON.load(File.read(metadata_json))
config.project = metadata['name']
end
rescue LoadError
end
# vim: syntax=ruby

View File

@@ -1,93 +0,0 @@
{
"CHANGELOG.md": "99a71b1e83bac9edf7966b4d47515317",
"Gemfile": "c118755e95766d6cbb843ad994062315",
"HISTORY.md": "af2c8adc63323368a08b1a4502f817f0",
"LICENSE.txt": "334e7e7d67642f88ea02717044cae990",
"README.md": "188b7ae3bfdedacdaae1c40d6f2d1ac9",
"REFERENCE.md": "31e45ced8323d7d694452c23f5a0b417",
"Rakefile": "3c6f218e7e63e1a6e24251f365423e49",
"lib/facter/phpversion.rb": "194eb2dcabcc462ab5b932e58284dc93",
"lib/puppet/parser/functions/ensure_prefix.rb": "f24c41ac785953666f35f26acff8380e",
"lib/puppet/parser/functions/to_hash_settings.rb": "940ee2a3e3f86bfe607e04babb434bf7",
"lib/puppet/provider/package/pear.rb": "be0a6f107f20d305732eec4b1f9f6418",
"lib/puppet/provider/package/pecl.rb": "c7619a858faaeb5d913e1c222b56878a",
"manifests/apache_config.pp": "e2cd06418eadd579e4713c3b3be03aad",
"manifests/apache_vhost.pp": "b48fb423c168dac2aff6f409996682dd",
"manifests/cli.pp": "20b4ff44d1cc07a6d12f1040feb49547",
"manifests/composer/auto_update.pp": "56086bcfa3e2550f908113ecf8feaa1b",
"manifests/composer.pp": "260f4d807a861d9b8b714ace1776b9fe",
"manifests/config/setting.pp": "93271dacf07aea9723287020193dd03c",
"manifests/config.pp": "8f43eae524ba5a71c33667b32415cf08",
"manifests/dev.pp": "01cbc9f4820d67c9a4c5cc467bee1a7d",
"manifests/embedded.pp": "a13c1895cc26c57b0c0fc7f0e0518532",
"manifests/extension/config.pp": "4480161d2e6312449205a22fb6d2a6b6",
"manifests/extension/install.pp": "020a50067193628f49c7389a9ef954e7",
"manifests/extension.pp": "0ee2cfff67d2e2f4e651f2451d797977",
"manifests/fpm/config.pp": "75c44ee7df1c096692160e7220816690",
"manifests/fpm/pool.pp": "a720a013e7c31e56a6936f76589b58ad",
"manifests/fpm/service.pp": "27b25d9e85e59101b52aacd5c71facb8",
"manifests/fpm.pp": "0ebb84e240dd878c56bb825398222147",
"manifests/global.pp": "49397c82fcf2f5798b260083faf4b74a",
"manifests/globals.pp": "9c1c626cbaf17987f5ec46ce16b16532",
"manifests/init.pp": "1394e610b0499278cb9257d9e526e647",
"manifests/packages.pp": "f1214743c25187e6186e85ca7e9b27cf",
"manifests/params.pp": "dc229c06154487257750c1be8fe655e6",
"manifests/pear.pp": "693c7a91b6c3f68cace2d9ae0dd70eae",
"manifests/phpunit/auto_update.pp": "48e2519cfdd6093dbc71df19b89a4291",
"manifests/phpunit.pp": "44e693b66b426cdbee6e2881351cda0d",
"manifests/repo/debian.pp": "621435c64a1bcb9ac6ad73b986826d59",
"manifests/repo/redhat.pp": "35d0dcabf16c6e0f887bd372ec46ce7a",
"manifests/repo/suse.pp": "40e46e9cf1270a65bbd73514fb0233c5",
"manifests/repo/ubuntu.pp": "41d2c1007b71f07dc7ea11e227e8db92",
"manifests/repo.pp": "1282593ceecbfd30823cad7ecc4301f1",
"metadata.json": "4f1f2e6bb8eda085718de74d835d7e73",
"spec/acceptance/nodesets/archlinux-2-x64.yml": "daafcfcb4c8c8766856f52cec6ae5e86",
"spec/acceptance/nodesets/centos-511-x64.yml": "ca8258bc835dd985a1754689d124cd66",
"spec/acceptance/nodesets/centos-6-x64.yml": "58065782a8d40780d9728257a23504cd",
"spec/acceptance/nodesets/centos-66-x64-pe.yml": "e68e03dc562bf58f7c5bba54a1a34619",
"spec/acceptance/nodesets/centos-66-x64.yml": "7ffa6d9164a88668fcd51a1988c4dc03",
"spec/acceptance/nodesets/centos-7-x64.yml": "68d3556f670b8ac0a169a8270ff8c37a",
"spec/acceptance/nodesets/centos-72-x64.yml": "194841a65e8835ac9ee6620e60b58f80",
"spec/acceptance/nodesets/debian-78-x64.yml": "56af2760a64c13a0bccd59404435939c",
"spec/acceptance/nodesets/debian-82-x64.yml": "26f2f696e6073549fe0a844f9a46f85b",
"spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml": "b3dc2d81918fcc6d56855c88ba5b7ce8",
"spec/acceptance/nodesets/ec2/image_templates.yaml": "516f9c4c3407993a100090ce9e1a643c",
"spec/acceptance/nodesets/ec2/rhel-73-x64.yml": "e74670a1cb8eea32afc879a5d786f9bd",
"spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml": "2506efcc9fb420132edc37bf88d6e21d",
"spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml": "87efd97ff1b073c3448f429a8ffc5a7c",
"spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml": "e9db4dd16c60c52b433694130c2583a0",
"spec/acceptance/nodesets/fedora-24-x64.yml": "431cd85b87a65a55af193a360aa52f26",
"spec/acceptance/nodesets/fedora-25-x64.yml": "807fbf45f95fc7bc2af8c689d34e4160",
"spec/acceptance/nodesets/fedora-26-x64.yml": "e7ee1e18590548ff098192c2127c6697",
"spec/acceptance/nodesets/fedora-27-x64.yml": "326a10c4eb327ccd85775dfa0f76e5c1",
"spec/acceptance/nodesets/ubuntu-server-1204-x64.yml": "0dd7639bf95bfb18169ebba9a2bac163",
"spec/acceptance/nodesets/ubuntu-server-1404-x64.yml": "7455367b784060b921360b29a56cd74c",
"spec/acceptance/nodesets/ubuntu-server-1604-x64.yml": "37673118cc3bf052755d65fb5dd90226",
"spec/acceptance/php56_spec.rb": "79a5371c11b60caaaebf90d3a3e0edfe",
"spec/acceptance/php_spec.rb": "268d78421a73d026ce6cc8dc5081b887",
"spec/classes/coverage_spec.rb": "166c74e93a4e70e9de79ae69f3c10e1d",
"spec/classes/php_fpm_config_spec.rb": "550e629393c4f90b22851a17b92e517d",
"spec/classes/php_fpm_service_spec.rb": "48920117c9393e0134c43c73d805c87e",
"spec/classes/php_fpm_spec.rb": "61db280801c531152a20f3646b658a3d",
"spec/classes/php_repo_spec.rb": "d61d779b4681ccdc002de6462f2fccaa",
"spec/classes/php_repo_ubuntu_spec.rb": "ae6db63d74befee2e3819fb57fa07fb2",
"spec/classes/php_spec.rb": "dd7ec4861ebab4f4ff82d965238a7eb5",
"spec/default_facts.yml": "3da74b0aff340a4fbcca9cc4eba104c1",
"spec/defines/config_spec.rb": "3a0faff5e42f58f4a868328588ac5715",
"spec/defines/extension_rhscl_spec.rb": "474ab7d83c28fb524d377a71b87f4209",
"spec/defines/extension_spec.rb": "0a3a570da733e4399d6ea8b7d9d373b0",
"spec/defines/fpm_pool_spec.rb": "7ae5bc8b5ae57f5cd9ca0c9721f347ef",
"spec/fixtures/unit/provider/package/pear/list_a": "e21e3019f1115de0c5f7754bc59d88f9",
"spec/fixtures/unit/provider/package/pear/remote-info_benchmark": "699128db50f31977c8866a5c8efd1e34",
"spec/fixtures/unit/provider/package/pear/remote-info_zip": "87e53069d6d61fcace02bd6895e759e2",
"spec/functions/to_hash_settings_spec.rb": "012c5a367409e8e881bfafb2774931c5",
"spec/spec_helper.rb": "72093296acb026b92861c5ba6d724836",
"spec/spec_helper_acceptance.rb": "7b58925fe0572a9f06d2d6b6aa2a024b",
"spec/unit/provider/package/pear_spec.rb": "cd1ac9b8220c5678d4aae871f4323e1a",
"spec/unit/provider/package/pecl_spec.rb": "9da69117867f17e6c96e3ed85832a09d",
"templates/fpm/php-fpm.conf.erb": "bdfc482191a65740840baff959f9ff34",
"templates/fpm/pool.conf.erb": "c63f2c7b8843a95b257843cad2c9218e",
"types/installoptions.pp": "6fbf1667dd8ee74d71c3cbd6ff656218",
"types/provider.pp": "fee028f7797609a228ccddede25d8594",
"types/sapi.pp": "8ea1c07f0b2d6853a14c5d7ed4aec051"
}

View File

@@ -1,10 +0,0 @@
Facter.add(:phpversion) do
setcode do
output = Facter::Util::Resolution.exec('php -v')
unless output.nil?
output.split("\n").first.split(' ').
select { |x| x =~ %r{^(?:(\d+)\.)(?:(\d+)\.)?(\*|\d+)} }.first
end
end
end

View File

@@ -1,57 +0,0 @@
module Puppet::Parser::Functions
newfunction(:ensure_prefix, type: :rvalue, doc: <<-EOS
This function ensures a prefix for all elements in an array or the keys in a hash.
*Examples:*
ensure_prefix({'a' => 1, 'b' => 2, 'p.c' => 3}, 'p.')
Will return:
{
'p.a' => 1,
'p.b' => 2,
'p.c' => 3,
}
ensure_prefix(['a', 'p.b', 'c'], 'p.')
Will return:
['p.a', 'p.b', 'p.c']
EOS
) do |arguments|
if arguments.size < 2
raise(Puppet::ParseError, 'ensure_prefix(): Wrong number of arguments ' \
"given (#{arguments.size} for 2)")
end
enumerable = arguments[0]
unless enumerable.is_a?(Array) || enumerable.is_a?(Hash)
raise Puppet::ParseError, "ensure_prefix(): expected first argument to be an Array or a Hash, got #{enumerable.inspect}"
end
prefix = arguments[1] if arguments[1]
if prefix
unless prefix.is_a?(String)
raise Puppet::ParseError, "ensure_prefix(): expected second argument to be a String, got #{prefix.inspect}"
end
end
result = if enumerable.is_a?(Array)
# Turn everything into string same as join would do ...
enumerable.map do |i|
i = i.to_s
prefix && !i.start_with?(prefix) ? prefix + i : i
end
else
Hash[enumerable.map do |k, v|
k = k.to_s
[prefix && !k.start_with?(prefix) ? prefix + k : k, v]
end]
end
return result
end
end

View File

@@ -1,37 +0,0 @@
module Puppet::Parser::Functions
newfunction(:to_hash_settings, type: :rvalue, doc: <<-EOS
This function converts a +{key => value}+ hash into a nested hash and can add an id to the outer key.
The optional id string as second parameter is prepended to the resource name.
*Examples:*
to_hash_settings({'a' => 1, 'b' => 2})
Would return:
{
'a' => {'key' => 'a', 'value' => 1},
'b' => {'key' => 'b', 'value' => 2}
}
and:
to_hash_settings({'a' => 1, 'b' => 2}, 'foo')
Would return:
{
'foo: a' => {'key' => 'a', 'value' => 1},
'foo: b' => {'key' => 'b', 'value' => 2}
}
EOS
) do |arguments|
hash, id = arguments
id = (id.nil? ? '' : "#{id}: ")
raise(Puppet::ParseError, 'to_hash_settings(): Requires hash to work with') unless hash.is_a?(Hash)
return hash.each_with_object({}) do |kv, acc|
acc[id + kv[0]] = { 'key' => kv[0], 'value' => kv[1] }
end
end
end

View File

@@ -1,109 +0,0 @@
require 'puppet/provider/package'
Puppet::Type.type(:package).provide :pear, parent: Puppet::Provider::Package do
desc 'Package management via `pear`.'
has_feature :versionable
has_feature :upgradeable
has_feature :install_options
commands pear: 'pear'
ENV['TERM'] = 'dumb' # remove colors
def self.pearlist(only = nil)
channel = nil
packages = pear('list', '-a').split("\n").map do |line|
# current channel
%r{INSTALLED PACKAGES, CHANNEL (.*):}i.match(line) { |m| channel = m[1].downcase }
# parse one package
pearsplit(line, channel)
end.compact
return packages unless only
packages.find do |pkg|
pkg[:name].casecmp(only[:name].downcase).zero?
end
end
def self.pearsplit(desc, channel)
desc.strip!
case desc
when '' then nil
when %r{^installed}i then nil
when %r{no packages installed}i then nil
when %r{^=} then nil
when %r{^package}i then nil
when %r{^(\S+)\s+(\S+)\s+(\S+)\s*$} then
name = Regexp.last_match(1)
version = Regexp.last_match(2)
state = Regexp.last_match(3)
{
name: name,
vendor: channel,
ensure: state == 'stable' ? version : state,
provider: self.name
}
else
Puppet.warning format('Could not match %s', desc)
nil
end
end
def self.instances
pearlist.map do |hash|
new(hash)
end
end
def install(useversion = true)
command = ['-D', 'auto_discover=1', 'upgrade']
if @resource[:install_options]
command += join_options(@resource[:install_options])
else
command << '--alldeps'
end
pear_pkg = @resource[:source] || @resource[:name]
if !@resource[:ensure].is_a?(Symbol) && useversion
command << '-f'
pear_pkg << "-#{@resource[:ensure]}"
end
command << pear_pkg
if @resource[:responsefile]
Puppet::Util::Execution.execute(
[command(:pear)] + command,
stdinfile: @resource[:responsefile]
)
else
pear(*command)
end
end
def latest
target = @resource[:source] || @resource[:name]
pear('remote-info', target).lines.find do |set|
set =~ %r{^Latest}
end.split[1]
end
def query
self.class.pearlist(@resource)
end
def uninstall
output = pear 'uninstall', @resource[:name]
raise Puppet::Error, output unless output =~ %r{^uninstall ok}
end
def update
install(false)
end
end

View File

@@ -1,38 +0,0 @@
require 'puppet/provider/package'
Puppet::Type.type(:package).provide :pecl, parent: :pear do
desc 'Package management via `pecl`.'
has_feature :versionable
has_feature :upgradeable
has_feature :install_options
commands pear: 'pear'
def self.instances
pear_packages = super
pear_packages.select do |pkg|
pkg.properties[:vendor] == 'pecl.php.net'
end
end
def convert_to_pear
@resource[:source] = "pecl.php.net/#{@resource[:name]}"
end
def install(useversion = true)
convert_to_pear
super(useversion)
end
def latest
convert_to_pear
super
end
def uninstall
convert_to_pear
super
end
end

View File

@@ -1,24 +0,0 @@
# Install and configure php apache settings
#
# === Parameters
#
# [*inifile*]
# The path to the ini php-apache ini file
#
# [*settings*]
# Hash with nested hash of key => value to set in inifile
#
class php::apache_config(
Stdlib::Absolutepath $inifile = $php::params::apache_inifile,
Hash $settings = {}
) inherits php::params {
assert_private()
$real_settings = deep_merge($settings, hiera_hash('php::apache::settings', {}))
php::config { 'apache':
file => $inifile,
config => $real_settings,
}
}

View File

@@ -1,35 +0,0 @@
# Configures an apache vhost for php
#
# === Parameters
#
# [*vhost*]
# The vhost address
#
# [*docroot*]
# The vhost docroot
#
# [*port*]
# The vhost port
#
# [*default_vhost*]
# defines if vhost is the default vhost
#
# [*fastcgi_socket*]
# address of the fastcgi socket
#
define php::apache_vhost(
$vhost = 'example.com',
$docroot = '/var/www',
$port = 80,
$default_vhost = true,
$fastcgi_socket = 'fcgi://127.0.0.1:9000/$1'
) {
::apache::vhost { $vhost:
docroot => $docroot,
default_vhost => $default_vhost,
port => $port,
override => 'all',
custom_fragment => "ProxyPassMatch ^/(.*\\.php(/.*)?)$ ${fastcgi_socket}",
}
}

View File

@@ -1,45 +0,0 @@
# Install and configure php CLI
#
# === Parameters
#
# [*inifile*]
# The path to the ini php5-cli ini file
#
# [*settings*]
# Hash with nested hash of key => value to set in inifile
#
class php::cli(
Stdlib::Absolutepath $inifile = $php::params::cli_inifile,
Hash $settings = {}
) inherits php::params {
assert_private()
if $php::globals::rhscl_mode {
# stupid fixes for scl
file {'/usr/bin/pear':
ensure => 'link',
target => "${$php::params::php_bin_dir}/pear",
}
file {'/usr/bin/pecl':
ensure => 'link',
target => "${$php::params::php_bin_dir}/pecl",
}
file {'/usr/bin/php':
ensure => 'link',
target => "${$php::params::php_bin_dir}/php",
}
}
$real_settings = deep_merge($settings, hiera_hash('php::cli::settings', {}))
if $inifile != $php::params::config_root_inifile {
# only create a cli specific inifile if the filenames are different
::php::config { 'cli':
file => $inifile,
config => $real_settings,
}
}
}

View File

@@ -1,59 +0,0 @@
# Install composer package manager
#
# === Parameters
#
# [*source*]
# Holds URL to the Composer source file
#
# [*path*]
# Holds path to the Composer executable
#
# [*proxy_type*]
# proxy server type (none|http|https|ftp)
#
# [*proxy_server*]
# specify a proxy server, with port number if needed. ie: https://example.com:8080.
#
# [*auto_update*]
# Defines if composer should be auto updated
#
# [*max_age*]
# Defines the time in days after which an auto-update gets executed
#
# [*root_group*]
# UNIX group of the root user
#
class php::composer (
String $source = $php::params::composer_source,
Stdlib::Absolutepath $path = $php::params::composer_path,
$proxy_type = undef,
$proxy_server = undef,
Boolean $auto_update = true,
Integer $max_age = $php::params::composer_max_age,
Variant[Integer, String] $root_group = $php::params::root_group,
) inherits php::params {
assert_private()
archive { 'download composer':
path => $path,
source => $source,
proxy_type => $proxy_type,
proxy_server => $proxy_server,
}
-> file { $path:
mode => '0555',
owner => root,
group => $root_group,
}
if $auto_update {
class { 'php::composer::auto_update':
max_age => $max_age,
source => $source,
path => $path,
proxy_type => $proxy_type,
proxy_server => $proxy_server,
}
}
}

View File

@@ -1,53 +0,0 @@
# Install composer package manager
#
# === Parameters
#
# [*max_age*]
# Defines number of days after which Composer should be updated
#
# [*source*]
# Holds URL to the Composer source file
#
# [*path*]
# Holds path to the Composer executable
#
# [*proxy_type*]
# proxy server type (none|http|https|ftp)
#
# [*proxy_server*]
# specify a proxy server, with port number if needed. ie: https://example.com:8080.
#
#
# === Examples
#
# include php::composer::auto_update
# class { "php::composer::auto_update":
# "max_age" => 90
# }
#
class php::composer::auto_update (
$max_age,
$source,
$path,
$proxy_type = undef,
$proxy_server = undef,
) {
assert_private()
if $proxy_type and $proxy_server {
$env = [ 'HOME=/root', "${proxy_type}_proxy=${proxy_server}" ]
} else {
$env = [ 'HOME=/root' ]
}
exec { 'update composer':
# touch binary when an update is attempted to update its mtime for idempotency when no update is available
command => "${path} --no-interaction --quiet self-update; touch ${path}",
environment => $env,
onlyif => "test `find '${path}' -mtime +${max_age}`",
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin', '/usr/local/sbin' ],
require => [File[$path], Class['::php::cli']],
}
}

View File

@@ -1,32 +0,0 @@
# Configure php.ini settings for a PHP SAPI
#
# === Parameters
#
# [*file*]
# The path to ini file
#
# [*config*]
# Nested hash of key => value to apply to php.ini
#
# === Examples
#
# php::config { '$unique-name':
# file => '$full_path_to_ini_file'
# config => {
# {'Date/date.timezone' => 'Europe/Berlin'}
# }
# }
#
define php::config(
Stdlib::Absolutepath $file,
Hash $config
) {
if $caller_module_name != $module_name {
warning('php::config is private')
}
create_resources(::php::config::setting, to_hash_settings($config, $file), {
file => $file
})
}

View File

@@ -1,52 +0,0 @@
# Configure php.ini settings
#
# === Parameters
#
# [*key*]
# The key of the value, like `ini_setting`
#
# [*file*]
# The path to ini file
#
# [*value*]
# The value to set
#
# === Examples
#
# php::config::setting { 'Date/date.timezone':
# file => '$full_path_to_ini_file'
# value => 'Europe/Berlin'
# }
#
define php::config::setting(
$key,
$value,
Stdlib::Absolutepath $file,
) {
assert_private()
$split_name = split($key, '/')
if count($split_name) == 1 {
$section = '' # lint:ignore:empty_string_assignment
$setting = $split_name[0]
} else {
$section = $split_name[0]
$setting = $split_name[1]
}
if $value == undef {
$ensure = 'absent'
} else {
$ensure = 'present'
}
ini_setting { $name:
ensure => $ensure,
value => $value,
path => $file,
section => $section,
setting => $setting,
}
}

View File

@@ -1,46 +0,0 @@
# Install the development package with headers for PHP
#
# === Parameters
#
# [*ensure*]
# The PHP ensure of PHP dev to install
#
# [*package*]
# The package name for the PHP development files
#
class php::dev(
String $ensure = $php::ensure,
String $package = "${php::package_prefix}${php::params::dev_package_suffix}",
Boolean $manage_repos = $php::manage_repos,
) inherits php::params {
assert_private()
# On FreeBSD there is no 'devel' package.
$real_package = $facts['os']['family'] ? {
'FreeBSD' => [],
default => $package,
}
if $facts['os']['family'] == 'Debian' {
# we can set the dependency only if we manage repos
$require = $manage_repos ? {
true => Class['::apt::update'],
false => undef,
}
} else {
$require = undef
}
# Default PHP come with xml module and no seperate package for it
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16.04') >= 0 {
ensure_packages(["${php::package_prefix}xml"], {
ensure => present,
require => $require,
})
}
package { $real_package:
ensure => $ensure,
require => Class['php::packages'],
}
}

View File

@@ -1,45 +0,0 @@
# Install and configure php embedded SAPI
#
# === Parameters
#
# [*inifile*]
# The path to the ini php5-embeded ini file
#
# [*settings*]
# Hash with nested hash of key => value to set in inifile
#
# [*package*]
# Specify which package to install
#
# [*ensure*]
# Specify which version of the package to install
#
class php::embedded(
String $ensure = $php::ensure,
String $package = "${php::package_prefix}${php::params::embedded_package_suffix}",
Stdlib::Absolutepath $inifile = $php::params::embedded_inifile,
Hash $settings = {},
) inherits php::params {
assert_private()
$real_settings = deep_merge(
$settings,
hiera_hash('php::embedded::settings', {})
)
$real_package = $facts['os']['family'] ? {
'Debian' => "lib${package}",
default => $package,
}
package { $real_package:
ensure => $ensure,
require => Class['php::packages'],
}
-> php::config { 'embedded':
file => $inifile,
config => $real_settings,
}
}

View File

@@ -1,137 +0,0 @@
# Install a PHP extension package
#
# === Parameters
#
# [*ensure*]
# The ensure of the package to install
# Could be "latest", "installed" or a pinned version
#
# [*package_prefix*]
# Prefix to prepend to the package name for the package provider
#
# [*provider*]
# The provider used to install the package
# Could be "pecl", "apt", "dpkg" or any other OS package provider
# If set to "none", no package will be installed
#
# [*source*]
# The source to install the extension from. Possible values
# depend on the *provider* used
#
# [*so_name*]
# The DSO name of the package (e.g. opcache for zendopcache)
#
# [*ini_prefix*]
# An optional filename prefix for the settings file of the extension
#
# [*php_api_version*]
# This parameter is used to build the full path to the extension
# directory for zend_extension in PHP < 5.5 (e.g. 20100525)
#
# [*header_packages*]
# System packages dependencies to install for extensions (e.g. for
# memcached libmemcached-dev on Debian)
#
# [*compiler_packages*]
# System packages dependencies to install for compiling extensions
# (e.g. build-essential on Debian)
#
# [*zend*]
# Boolean parameter, whether to load extension as zend_extension.
# Defaults to false.
#
# [*settings*]
# Hash of parameters for the specific extension, which will be written to the extensions config file by
# php::extension::config or a hash of mutliple settings files, each with parameters
# (multifile_settings must be true)
# (f.ex. {p => '..'} or {'bz2' => {..}, {'math' => {...}})
#
# [*multifile_settings*]
# Set this to true if you specify multiple setting files in *settings*. This must be used when the PHP package
# distribution bundles extensions in a single package (like 'common' bundles extensions 'bz2', ...) and each of
# the extension comes with a separate settings file.
#
# [*settings_prefix*]
# Boolean/String parameter, whether to prefix all setting keys with
# the extension name or specified name. Defaults to false.
#
# [*sapi*]
# String parameter, whether to specify ALL sapi or a specific sapi.
# Defaults to ALL.
#
# [*responsefile*]
# File containing answers for interactive extension setup. Supported
# *providers*: pear, pecl.
#
# [*install_options*]
# Array of String or Hash options to pass to the provider.
#
define php::extension (
String $ensure = 'installed',
Optional[Php::Provider] $provider = undef,
Optional[String] $source = undef,
Optional[String] $so_name = undef,
Optional[String] $ini_prefix = undef,
Optional[String] $php_api_version = undef,
String $package_prefix = $php::package_prefix,
Boolean $zend = false,
Variant[Hash, Hash[String, Hash]] $settings = {},
Boolean $multifile_settings = false,
Php::Sapi $sapi = 'ALL',
Variant[Boolean, String] $settings_prefix = false,
Optional[Stdlib::AbsolutePath] $responsefile = undef,
Variant[String, Array[String]] $header_packages = [],
Variant[String, Array[String]] $compiler_packages = $php::params::compiler_packages,
Php::InstallOptions $install_options = undef,
) {
if ! defined(Class['php']) {
warning('php::extension is private')
}
php::extension::install { $title:
ensure => $ensure,
provider => $provider,
source => $source,
responsefile => $responsefile,
package_prefix => $package_prefix,
header_packages => $header_packages,
compiler_packages => $compiler_packages,
install_options => $install_options,
}
# PEAR packages don't require any further configuration, they just need to "be there".
if $provider != 'pear' {
$_settings = $multifile_settings ? {
true => $settings,
false => { downcase($title) => $settings } # emulate a hash if no multifile settings
}
$_settings.each |$settings_name, $settings_hash| {
if $so_name {
$so_name = $multifile_settings ? {
true => downcase($settings_name),
false => pick(downcase($so_name), downcase($name), downcase($settings_name)),
}
} else {
$so_name = $multifile_settings ? {
true => downcase($settings_name),
false => pick(downcase($name), downcase($settings_name)),
}
}
php::extension::config { $settings_name:
ensure => $ensure,
provider => $provider,
so_name => $so_name,
ini_prefix => $ini_prefix,
php_api_version => $php_api_version,
zend => $zend,
settings => $settings_hash,
settings_prefix => $settings_prefix,
sapi => $sapi,
subscribe => Php::Extension::Install[$title],
}
}
}
}

View File

@@ -1,128 +0,0 @@
# Configure a PHP extension package
#
# === Parameters
#
# [*ensure*]
# The ensure of the package to install
# Could be "latest", "installed" or a pinned version
#
# [*provider*]
# The provider used to install the package
# Could be "pecl", "apt", "dpkg" or any other OS package provider
# If set to "none", no package will be installed
#
# [*so_name*]
# The DSO name of the package (e.g. opcache for zendopcache)
#
# [*ini_prefix*]
# An optional filename prefix for the settings file of the extension
#
# [*php_api_version*]
# This parameter is used to build the full path to the extension
# directory for zend_extension in PHP < 5.5 (e.g. 20100525)
#
# [*header_packages*]
# System packages dependencies to install for extensions (e.g. for
# memcached libmemcached-dev on Debian)
#
# [*compiler_packages*]
# System packages dependencies to install for compiling extensions
# (e.g. build-essential on Debian)
#
# [*zend*]
# Boolean parameter, whether to load extension as zend_extension.
# Defaults to false.
#
# [*settings*]
# Nested hash of global config parameters for php.ini
#
# [*settings_prefix*]
# Boolean/String parameter, whether to prefix all setting keys with
# the extension name or specified name. Defaults to false.
#
# [*sapi*]
# String parameter, whether to specify ALL sapi or a specific sapi.
# Defaults to ALL.
#
define php::extension::config (
String $ensure = 'installed',
Optional[Php::Provider] $provider = undef,
Optional[String] $so_name = downcase($name),
Optional[String] $ini_prefix = undef,
Optional[String] $php_api_version = undef,
Boolean $zend = false,
Hash $settings = {},
Variant[Boolean, String] $settings_prefix = false,
Php::Sapi $sapi = 'ALL',
) {
if ! defined(Class['php']) {
warning('php::extension::config is private')
}
if $zend == true {
$extension_key = 'zend_extension'
$module_path = $php_api_version? {
undef => undef,
default => "/usr/lib/php5/${php_api_version}/",
}
} else {
$extension_key = 'extension'
$module_path = undef
}
$ini_name = downcase($so_name)
# Ensure "<extension>." prefix is present in setting keys if requested
$full_settings = $settings_prefix? {
true => ensure_prefix($settings, "${so_name}."),
false => $settings,
String => ensure_prefix($settings, "${settings_prefix}."),
}
if $provider != 'pear' {
$final_settings = deep_merge(
{"${extension_key}" => "${module_path}${so_name}.so"},
$full_settings
)
} else {
$final_settings = $full_settings
}
$config_root_ini = pick_default($php::config_root_ini, $php::params::config_root_ini)
if $ensure == 'present' or $ensure == 'installed' {
::php::config { $title:
file => "${config_root_ini}/${ini_prefix}${ini_name}.ini",
config => $final_settings,
}
# Ubuntu/Debian systems use the mods-available folder. We need to enable
# settings files ourselves with php5enmod command.
$ext_tool_enable = pick_default($php::ext_tool_enable, $php::params::ext_tool_enable)
$ext_tool_query = pick_default($php::ext_tool_query, $php::params::ext_tool_query)
$ext_tool_enabled = pick_default($php::ext_tool_enabled, $php::params::ext_tool_enabled)
if $facts['os']['family'] == 'Debian' and $ext_tool_enabled {
$cmd = "${ext_tool_enable} -s ${sapi} ${so_name}"
$_sapi = $sapi? {
'ALL' => 'cli',
default => $sapi,
}
if has_key($final_settings, 'extension') and $final_settings[extension] {
exec { $cmd:
onlyif => "${ext_tool_query} -s ${_sapi} -m ${so_name} | /bin/grep 'No module matches ${so_name}'",
require => ::Php::Config[$title],
}
if $php::fpm {
Package[$php::fpm::package] ~> Exec[$cmd]
}
}
}
} else {
file {"${config_root_ini}/${ini_prefix}${ini_name}.ini":
ensure => 'absent',
}
}
}

View File

@@ -1,90 +0,0 @@
# Install a PHP extension package
#
# === Parameters
#
# [*ensure*]
# The ensure of the package to install
# Could be "latest", "installed" or a pinned version
#
# [*package_prefix*]
# Prefix to prepend to the package name for the package provider
#
# [*provider*]
# The provider used to install the package
# Could be "pecl", "apt", "dpkg" or any other OS package provider
# If set to "none", no package will be installed
#
# [*source*]
# The source to install the extension from. Possible values
# depend on the *provider* used
#
# [*header_packages*]
# System packages dependencies to install for extensions (e.g. for
# memcached libmemcached-dev on Debian)
#
# [*compiler_packages*]
# System packages dependencies to install for compiling extensions
# (e.g. build-essential on Debian)
#
# [*responsefile*]
# File containing answers for interactive extension setup. Supported
# *providers*: pear, pecl.
#
# [*install_options*]
# Array of String or Hash options to pass to the provider.
#
define php::extension::install (
String $ensure = 'installed',
Optional[Php::Provider] $provider = undef,
Optional[String] $source = undef,
String $package_prefix = $php::package_prefix,
Optional[Stdlib::AbsolutePath] $responsefile = undef,
Variant[String, Array[String]] $header_packages = [],
Variant[String, Array[String]] $compiler_packages = $php::params::compiler_packages,
Php::InstallOptions $install_options = undef,
) {
if ! defined(Class['php']) {
warning('php::extension::install is private')
}
case $provider {
/pecl|pear/: {
$real_package = $title
unless empty($header_packages) {
ensure_resource('package', $header_packages)
Package[$header_packages] -> Package[$real_package]
}
unless empty($compiler_packages) {
ensure_resource('package', $compiler_packages)
Package[$compiler_packages] -> Package[$real_package]
}
$package_require = [
Class['::php::pear'],
Class['::php::dev'],
]
}
'none' : {
debug("No package installed for php::extension: `${title}`.")
}
default: {
$real_package = "${package_prefix}${title}"
$package_require = undef
}
}
unless $provider == 'none' {
package { $real_package:
ensure => $ensure,
provider => $provider,
source => $source,
responsefile => $responsefile,
install_options => $install_options,
require => $package_require,
}
}
}

View File

@@ -1,122 +0,0 @@
# Install and configure mod_php for fpm
#
# === Parameters
#
# [*user*]
# The user that php-fpm should run as
#
# [*group*]
# The group that php-fpm should run as
#
# [*service_enable*]
# Enable/disable FPM service
#
# [*service_ensure*]
# Ensure FPM service is either 'running' or 'stopped'
#
# [*service_name*]
# This is the name of the php-fpm service. It defaults to reasonable OS
# defaults but can be different in case of using php7.0/other OS/custom fpm service
#
# [*service_provider*]
# This is the name of the service provider, in case there is a non
# OS default service provider used to start FPM.
# Defaults to 'undef', pick system defaults.
#
# [*pools*]
# Hash of php::fpm::pool resources that will be created. Defaults
# to a single php::fpm::pool named www with default parameters.
#
# [*log_owner*]
# The php-fpm log owner
#
# [*log_group*]
# The group owning php-fpm logs
#
# [*package*]
# Specify which package to install
#
# [*ensure*]
# Specify which version of the package to install
#
# [*inifile*]
# Path to php.ini for fpm
#
# [*settings*]
# fpm settings hash
#
# [*global_pool_settings*]
# Hash of defaults params php::fpm::pool resources that will be created.
# Defaults is empty hash.
#
class php::fpm (
String $ensure = $php::ensure,
$user = $php::fpm_user,
$group = $php::fpm_group,
$service_ensure = $php::fpm_service_ensure,
$service_enable = $php::fpm_service_enable,
$service_name = $php::fpm_service_name,
$service_provider = $php::fpm_service_provider,
String $package = $php::real_fpm_package,
Stdlib::Absolutepath $inifile = $php::fpm_inifile,
Hash $settings = $php::real_settings,
$global_pool_settings = $php::real_fpm_global_pool_settings,
Hash $pools = $php::real_fpm_pools,
$log_owner = $php::log_owner,
$log_group = $php::log_group,
) {
if ! defined(Class['php']) {
warning('php::fpm is private')
}
$real_settings = deep_merge($settings, hiera_hash('php::fpm::settings', {}))
# On FreeBSD fpm is not a separate package, but included in the 'php' package.
# Implies that the option SET+=FPM was set when building the port.
$real_package = $facts['os']['family'] ? {
'FreeBSD' => [],
default => $package,
}
package { $real_package:
ensure => $ensure,
require => Class['php::packages'],
}
class { 'php::fpm::config':
user => $user,
group => $group,
inifile => $inifile,
settings => $real_settings,
log_owner => $log_owner,
log_group => $log_group,
require => Package[$real_package],
}
contain 'php::fpm::config'
contain 'php::fpm::service'
Class['php::fpm::config'] ~> Class['php::fpm::service']
$real_global_pool_settings = hiera_hash('php::fpm::global_pool_settings', $global_pool_settings)
$real_pools = hiera_hash('php::fpm::pools', $pools)
create_resources(::php::fpm::pool, $real_pools, $real_global_pool_settings)
# Create an override to use a reload signal as trusty and utopic's
# upstart version supports this
if ($facts['os']['name'] == 'Ubuntu'
and versioncmp($facts['os']['release']['full'], '14') >= 0
and versioncmp($facts['os']['release']['full'], '16') < 0) {
if ($service_enable) {
$fpm_override = 'reload signal USR2'
}
else {
$fpm_override = "reload signal USR2\nmanual"
}
file { "/etc/init/${::php::fpm::service::service_name}.override":
content => $fpm_override,
before => Package[$real_package],
}
}
}

View File

@@ -1,140 +0,0 @@
# Configure php-fpm service
#
# === Parameters
#
# [*config_file*]
# The path to the fpm config file
#
# [*user*]
# The user that runs php-fpm
#
# [*group*]
# The group that runs php-fpm
#
# [*inifile*]
# The path to ini file
#
# [*settings*]
# Nested hash of key => value to apply to php.ini
#
# [*pool_base_dir*]
# The folder that contains the php-fpm pool configs
#
# [*pool_purge*]
# Whether to purge pool config files not created
# by this module
#
# [*error_log*]
# Path to error log file. If it's set to "syslog", log is
# sent to syslogd instead of being written in a local file.
#
# [*log_level*]
# The php-fpm log level
#
# [*emergency_restart_threshold*]
# The php-fpm emergency_restart_threshold
#
# [*emergency_restart_interval*]
# The php-fpm emergency_restart_interval
#
# [*process_control_timeout*]
# The php-fpm process_control_timeout
#
# [*process_max*]
# The maximum number of processes FPM will fork.
#
# [*rlimit_files*]
# Set open file descriptor rlimit for the master process.
#
# [*systemd_interval*]
# The interval between health report notification to systemd
#
# [*log_owner*]
# The php-fpm log owner
#
# [*log_group*]
# The group owning php-fpm logs
#
# [*log_dir_mode*]
# The octal mode of the directory
#
# [*syslog_facility*]
# Used to specify what type of program is logging the message
#
# [*syslog_ident*]
# Prepended to every message
#
# [*root_group*]
# UNIX group of the root user
#
# [*pid_file*]
# Path to fpm pid file
#
class php::fpm::config(
$config_file = $php::params::fpm_config_file,
String $user = $php::params::fpm_user,
String $group = $php::params::fpm_group,
String $inifile = $php::params::fpm_inifile,
$pid_file = $php::params::fpm_pid_file,
Hash $settings = {},
Stdlib::Absolutepath $pool_base_dir = $php::params::fpm_pool_dir,
$pool_purge = false,
String $error_log = $php::params::fpm_error_log,
String $log_level = 'notice',
Integer $emergency_restart_threshold = 0,
Variant[Integer, Pattern[/^\d+[smhd]?$/]] $emergency_restart_interval = 0,
Variant[Integer, Pattern[/^\d+[smhd]?$/]] $process_control_timeout = 0,
Integer $process_max = 0,
$rlimit_files = undef,
Optional[Variant[Integer,Pattern[/^\d+[smhd]?$/]]] $systemd_interval = undef,
String $log_owner = $php::params::fpm_user,
String $log_group = $php::params::fpm_group,
Pattern[/^\d+$/] $log_dir_mode = '0770',
$root_group = $php::params::root_group,
String $syslog_facility = 'daemon',
String $syslog_ident = 'php-fpm',
) inherits php::params {
assert_private()
# Hack-ish to default to user for group too
$log_group_final = $log_group ? {
undef => $log_owner,
default => $log_group,
}
file { $config_file:
ensure => file,
content => template('php/fpm/php-fpm.conf.erb'),
owner => root,
group => $root_group,
mode => '0644',
}
ensure_resource('file', ['/var/run/php-fpm/', '/var/log/php-fpm/'], {
ensure => directory,
owner => $user,
group => $group,
})
file { $pool_base_dir:
ensure => directory,
owner => root,
group => $root_group,
mode => '0755',
}
if $pool_purge {
File[$pool_base_dir] {
purge => true,
recurse => true,
}
}
if $inifile != $php::params::config_root_inifile {
::php::config { 'fpm':
file => $inifile,
config => $settings,
}
}
}

View File

@@ -1,199 +0,0 @@
# Configure fpm pools
#
# === Parameters
#
# See the official php-fpm documentation for parameters that are not
# documented here: http://php.net/manual/en/install.fpm.configuration.php.
#
# [*ensure*]
# Remove pool if set to `'absent'`, add otherwise
#
# [*listen*]
# On what socket to listen for FastCGI connections, i.e.
# `'127.0.0.1:9000'' or `'/var/run/php5-fpm.sock'`
#
# [*listen_backlog*]
#
# [*listen_allowed_clients*]
#
# [*listen_owner*]
# Set owner of the Unix socket
#
# [*listen_group*]
# Set the group of the Unix socket
#
# [*listen_mode*]
#
# [*user*]
# The user that php-fpm should run as
#
# [*group*]
# The group that php-fpm should run as
#
# [*pm*]
#
# [*pm_max_children*]
#
# [*pm_start_servers*]
#
# [*pm_min_spare_servers*]
#
# [*pm_max_spare_servers*]
#
# [*pm_max_requests*]
#
# [*pm_process_idle_timeout*]
#
# [*pm_status_path*]
#
# [*ping_path*]
#
# [*ping_response*]
#
# [*access_log*]
# The path to the file to write access log requests to
#
# [*access_log_format*]
# The format to save the access log entries as
#
# [*request_terminate_timeout*]
#
# [*request_slowlog_timeout*]
#
# [*security_limit_extensions*]
#
# [*slowlog*]
#
# [*template*]
# The template to use for the pool
#
# [*rlimit_files*]
#
# [*rlimit_core*]
#
# [*chroot*]
#
# [*chdir*]
#
# [*catch_workers_output*]
#
# [*include*]
# Other configuration files to include on this pool
#
# [*env*]
# List of environment variables that are passed to the php-fpm from the
# outside and will be available to php scripts in this pool
#
# [*env_value*]
# Hash of environment variables and values as strings to use in php
# scripts in this pool
#
# [*options*]
# An optional hash for any other data.
#
# [*php_value*]
# Hash of php_value directives
#
# [*php_flag*]
# Hash of php_flag directives
#
# [*php_admin_value*]
# Hash of php_admin_value directives
#
# [*php_admin_flag*]
# Hash of php_admin_flag directives
#
# [*php_directives*]
# List of custom directives that are appended to the pool config
#
# [*root_group*]
# UNIX group of the root user
#
# [*base_dir*]
# The folder that contains the php-fpm pool configs. This defaults to a
# sensible default depending on your operating system, like
# '/etc/php5/fpm/pool.d' or '/etc/php-fpm.d'
#
define php::fpm::pool (
$ensure = 'present',
$listen = '127.0.0.1:9000',
$listen_backlog = '-1',
$listen_allowed_clients = undef,
$listen_owner = undef,
$listen_group = undef,
$listen_mode = undef,
$user = $php::fpm::config::user,
$group = $php::fpm::config::group,
$pm = 'dynamic',
$pm_max_children = '50',
$pm_start_servers = '5',
$pm_min_spare_servers = '5',
$pm_max_spare_servers = '35',
$pm_max_requests = '0',
$pm_process_idle_timeout = '10s',
$pm_status_path = undef,
$ping_path = undef,
$ping_response = 'pong',
$access_log = undef,
$access_log_format = '"%R - %u %t \"%m %r\" %s"',
$request_terminate_timeout = '0',
$request_slowlog_timeout = '0',
$security_limit_extensions = undef,
$slowlog = "/var/log/php-fpm/${name}-slow.log",
$template = 'php/fpm/pool.conf.erb',
$rlimit_files = undef,
$rlimit_core = undef,
$chroot = undef,
$chdir = undef,
$catch_workers_output = 'no',
$include = undef,
$env = [],
$env_value = {},
$options = {},
$php_value = {},
$php_flag = {},
$php_admin_value = {},
$php_admin_flag = {},
$php_directives = [],
$root_group = $php::params::root_group,
Optional[Stdlib::Absolutepath] $base_dir = undef,
) {
# The base class must be included first because it is used by parameter defaults
if ! defined(Class['php']) {
warning('You must include the php base class before using any php defined resources')
}
$pool = $title
# Hack-ish to default to user for group too
$group_final = $group ? {
undef => $user,
default => $group
}
# On FreeBSD fpm is not a separate package, but included in the 'php' package.
# Implies that the option SET+=FPM was set when building the port.
$real_package = $facts['os']['name'] ? {
'FreeBSD' => [],
default => $php::fpm::package,
}
$pool_base_dir = pick_default($base_dir, $php::fpm::config::pool_base_dir, $php::params::fpm_pool_dir)
if ($ensure == 'absent') {
file { "${pool_base_dir}/${pool}.conf":
ensure => absent,
notify => Class['::php::fpm::service'],
}
} else {
file { "${pool_base_dir}/${pool}.conf":
ensure => file,
notify => Class['::php::fpm::service'],
require => Package[$real_package],
content => template($template),
owner => root,
group => $root_group,
mode => '0644',
}
}
}

View File

@@ -1,50 +0,0 @@
# Manage fpm service
#
# === Parameters
#
# [*service_name*]
# name of the php-fpm service
#
# [*ensure*]
# 'ensure' value for the service
#
# [*enable*]
# Defines if the service is enabled
#
# [*provider*]
# Defines if the service provider to use
#
class php::fpm::service(
$service_name = $php::fpm::service_name,
$ensure = $php::fpm::service_ensure,
$enable = $php::fpm::service_enable,
$provider = $php::fpm::service_provider,
) {
if ! defined(Class['php::fpm']) {
warning('php::fpm::service is private')
}
$reload = "service ${service_name} reload"
if ($facts['os']['name'] == 'Ubuntu'
and versioncmp($facts['os']['release']['full'], '12') >= 0
and versioncmp($facts['os']['release']['full'], '14') < 0) {
# Precise upstart doesn't support reload signals, so use
# regular service restart instead
$restart = undef
} else {
$restart = $reload
}
service { $service_name:
ensure => $ensure,
enable => $enable,
provider => $provider,
hasrestart => true,
restart => $restart,
hasstatus => true,
}
::Php::Extension <| |> ~> Service[$service_name]
}

View File

@@ -1,28 +0,0 @@
# Install and configure mod_php for fpm
#
# === Parameters
#
# [*inifile*]
# Absolute path to the global php.ini file. Defaults
# to the OS specific default location as defined in params.
# [*settings*]
# Hash of settings to apply to the global php.ini file.
# Defaults to OS specific defaults (i.e. add nothing)
#
#
class php::global(
Stdlib::Absolutepath $inifile = $php::config_root_inifile,
Hash $settings = {}
) inherits ::php {
assert_private()
# No deep merging required since the settings we have are the global settings.
$real_settings = $settings
::php::config { 'global':
file => $inifile,
config => $real_settings,
}
}

View File

@@ -1,160 +0,0 @@
# PHP globals class
#
# === Parameters
#
# [*php_version*]
# The version of php.
#
# [*config_root*]
# The configuration root directory.
#
# [*fpm_pid_file*]
# Path to pid file for fpm
#
# [*rhscl_mode*]
# The mode specifies the specifics in paths for the various RedHat SCL environments so that the module is configured
# correctly on their pathnames.
#
# Valid modes are: 'rhscl', 'remi'
#
class php::globals (
Optional[Pattern[/^(rh-)?(php)?[57](\.)?[0-9]/]] $php_version = undef,
Optional[Stdlib::Absolutepath] $config_root = undef,
Optional[Stdlib::Absolutepath] $fpm_pid_file = undef,
$rhscl_mode = undef,
) {
$default_php_version = $facts['os']['name'] ? {
'Debian' => $facts['os']['release']['major'] ? {
'9' => '7.0',
default => '5.x',
},
'Ubuntu' => $facts['os']['release']['major'] ? {
'18.04' => '7.2',
'16.04' => '7.0',
default => '5.x',
},
default => '5.x',
}
$globals_php_version = pick($php_version, $default_php_version)
case $facts['os']['family'] {
'Debian': {
if $facts['os']['name'] == 'Ubuntu' {
case $globals_php_version {
/^5\.4/: {
$default_config_root = '/etc/php5'
$default_fpm_pid_file = "/var/run/php/php${globals_php_version}-fpm.pid"
$fpm_error_log = '/var/log/php5-fpm.log'
$fpm_service_name = 'php5-fpm'
$ext_tool_enable = '/usr/sbin/php5enmod'
$ext_tool_query = '/usr/sbin/php5query'
$package_prefix = 'php5-'
}
/^[57].[0-9]/: {
$default_config_root = "/etc/php/${globals_php_version}"
$default_fpm_pid_file = "/var/run/php/php${globals_php_version}-fpm.pid"
$fpm_error_log = "/var/log/php${globals_php_version}-fpm.log"
$fpm_service_name = "php${globals_php_version}-fpm"
$ext_tool_enable = "/usr/sbin/phpenmod -v ${globals_php_version}"
$ext_tool_query = "/usr/sbin/phpquery -v ${globals_php_version}"
$package_prefix = "php${globals_php_version}-"
}
default: {
# Default php installation from Ubuntu official repository use the following paths until 16.04
# For PPA please use the $php_version to override it.
$default_config_root = '/etc/php5'
$default_fpm_pid_file = '/var/run/php5-fpm.pid'
$fpm_error_log = '/var/log/php5-fpm.log'
$fpm_service_name = 'php5-fpm'
$ext_tool_enable = '/usr/sbin/php5enmod'
$ext_tool_query = '/usr/sbin/php5query'
$package_prefix = 'php5-'
}
}
} else {
case $globals_php_version {
/^7\.[0-9]/: {
$default_config_root = "/etc/php/${globals_php_version}"
$default_fpm_pid_file = "/var/run/php/php${globals_php_version}-fpm.pid"
$fpm_error_log = "/var/log/php${globals_php_version}-fpm.log"
$fpm_service_name = "php${globals_php_version}-fpm"
$ext_tool_enable = "/usr/sbin/phpenmod -v ${globals_php_version}"
$ext_tool_query = "/usr/sbin/phpquery -v ${globals_php_version}"
$package_prefix = "php${globals_php_version}-"
}
default: {
$default_config_root = '/etc/php5'
$default_fpm_pid_file = '/var/run/php5-fpm.pid'
$fpm_error_log = '/var/log/php5-fpm.log'
$fpm_service_name = 'php5-fpm'
$ext_tool_enable = '/usr/sbin/php5enmod'
$ext_tool_query = '/usr/sbin/php5query'
$package_prefix = 'php5-'
}
}
}
}
'Suse': {
case $globals_php_version {
/^7/: {
$default_config_root = '/etc/php7'
$package_prefix = 'php7-'
$default_fpm_pid_file = '/var/run/php7-fpm.pid'
$fpm_error_log = '/var/log/php7-fpm.log'
}
default: {
$default_config_root = '/etc/php5'
$package_prefix = 'php5-'
$default_fpm_pid_file = '/var/run/php5-fpm.pid'
$fpm_error_log = '/var/log/php5-fpm.log'
}
}
}
'RedHat': {
case $rhscl_mode {
'remi': {
$rhscl_root = "/opt/remi/${php_version}/root"
$default_config_root = "/etc/opt/remi/${php_version}"
$default_fpm_pid_file = '/var/run/php-fpm/php-fpm.pid'
$package_prefix = "${php_version}-php-"
$fpm_service_name = "${php_version}-php-fpm"
}
'rhscl': {
$rhscl_root = "/opt/rh/${php_version}/root"
$default_config_root = "/etc/opt/rh/${php_version}" # rhscl registers contents by copy in /etc/opt/rh
$default_fpm_pid_file = "/var/opt/rh/${php_version}/run/php-fpm/php-fpm.pid"
$package_prefix = "${php_version}-php-"
$fpm_service_name = "${php_version}-php-fpm"
}
undef: {
$default_config_root = '/etc/php.d'
$default_fpm_pid_file = '/var/run/php-fpm/php-fpm.pid'
$fpm_service_name = undef
$package_prefix = undef
}
default: {
fail("Unsupported rhscl_mode '${rhscl_mode}'")
}
}
}
'FreeBSD': {
$default_config_root = '/usr/local/etc'
$default_fpm_pid_file = '/var/run/php-fpm.pid'
$fpm_service_name = undef
}
'Archlinux': {
$default_config_root = '/etc/php'
$default_fpm_pid_file = '/run/php-fpm/php-fpm.pid'
}
default: {
fail("Unsupported osfamily: ${facts['os']['family']}")
}
}
$globals_config_root = pick($config_root, $default_config_root)
$globals_fpm_pid_file = pick($fpm_pid_file, $default_fpm_pid_file)
}

View File

@@ -1,238 +0,0 @@
# Base class with global configuration parameters that pulls in all
# enabled components.
#
# === Parameters
#
# [*ensure*]
# Specify which version of PHP packages to install, defaults to 'present'.
# Please note that 'absent' to remove packages is not supported!
#
# [*manage_repos*]
# Include repository (dotdeb, ppa, etc.) to install recent PHP from
#
# [*fpm*]
# Install and configure php-fpm
#
# [*fpm_service_enable*]
# Enable/disable FPM service
#
# [*fpm_service_ensure*]
# Ensure FPM service is either 'running' or 'stopped'
#
# [*fpm_service_name*]
# This is the name of the php-fpm service. It defaults to reasonable OS
# defaults but can be different in case of using php7.0/other OS/custom fpm service
#
# [*fpm_service_provider*]
# This is the name of the service provider, in case there is a non
# OS default service provider used to start FPM.
# Defaults to 'undef', pick system defaults.
#
# [*fpm_pools*]
# Hash of php::fpm::pool resources that will be created. Defaults
# to a single php::fpm::pool named www with default parameters.
#
# [*fpm_global_pool_settings*]
# Hash of defaults params php::fpm::pool resources that will be created.
# Defaults to empty hash.
#
# [*fpm_inifile*]
# Path to php.ini for fpm
#
# [*fpm_package*]
# Name of fpm package to install
#
# [*fpm_user*]
# The user that php-fpm should run as
#
# [*fpm_group*]
# The group that php-fpm should run as
#
# [*dev*]
# Install php header files, needed to install pecl modules
#
# [*composer*]
# Install and auto-update composer
#
# [*pear*]
# Install PEAR
#
# [*phpunit*]
# Install phpunit
#
# [*apache_config*]
# Manage apache's mod_php configuration
#
# [*proxy_type*]
# proxy server type (none|http|https|ftp)
#
# [*proxy_server*]
# specify a proxy server, with port number if needed. ie: https://example.com:8080.
#
# [*extensions*]
# Install PHP extensions, this is overwritten by hiera hash `php::extensions`
#
# [*package_prefix*]
# This is the prefix for constructing names of php packages. This defaults
# to a sensible default depending on your operating system, like 'php-' or
# 'php5-'.
#
# [*config_root_ini*]
# This is the path to the config .ini files of the extensions. This defaults
# to a sensible default depending on your operating system, like
# '/etc/php5/mods-available' or '/etc/php5/conf.d'.
#
# [*config_root_inifile*]
# The path to the global php.ini file. This defaults to a sensible default
# depending on your operating system.
#
# [*ext_tool_enable*]
# Absolute path to php tool for enabling extensions in debian/ubuntu systems.
# This defaults to '/usr/sbin/php5enmod'.
#
# [*ext_tool_query*]
# Absolute path to php tool for querying information about extensions in
# debian/ubuntu systems. This defaults to '/usr/sbin/php5query'.
#
# [*ext_tool_enabled*]
# Enable or disable the use of php tools on debian based systems
# debian/ubuntu systems. This defaults to 'true'.
#
# [*log_owner*]
# The php-fpm log owner
#
# [*log_group*]
# The group owning php-fpm logs
#
# [*embedded*]
# Enable embedded SAPI
#
# [*pear_ensure*]
# The package ensure of PHP pear to install and run pear auto_discover
#
# [*settings*]
#
class php (
String $ensure = $php::params::ensure,
Boolean $manage_repos = $php::params::manage_repos,
Boolean $fpm = true,
$fpm_service_enable = $php::params::fpm_service_enable,
$fpm_service_ensure = $php::params::fpm_service_ensure,
$fpm_service_name = $php::params::fpm_service_name,
$fpm_service_provider = undef,
Hash $fpm_pools = { 'www' => {} },
Hash $fpm_global_pool_settings = {},
$fpm_inifile = $php::params::fpm_inifile,
$fpm_package = undef,
$fpm_user = $php::params::fpm_user,
$fpm_group = $php::params::fpm_group,
Boolean $embedded = false,
Boolean $dev = true,
Boolean $composer = true,
Boolean $pear = true,
String $pear_ensure = $php::params::pear_ensure,
Boolean $phpunit = false,
Boolean $apache_config = false,
$proxy_type = undef,
$proxy_server = undef,
Hash $extensions = {},
Hash $settings = {},
$package_prefix = $php::params::package_prefix,
Stdlib::Absolutepath $config_root_ini = $php::params::config_root_ini,
Stdlib::Absolutepath $config_root_inifile = $php::params::config_root_inifile,
Optional[Stdlib::Absolutepath] $ext_tool_enable = $php::params::ext_tool_enable,
Optional[Stdlib::Absolutepath] $ext_tool_query = $php::params::ext_tool_query,
Boolean $ext_tool_enabled = $php::params::ext_tool_enabled,
String $log_owner = $php::params::fpm_user,
String $log_group = $php::params::fpm_group,
) inherits php::params {
$real_fpm_package = pick($fpm_package, "${package_prefix}${::php::params::fpm_package_suffix}")
$real_settings = $settings
$real_extensions = $extensions
$real_fpm_pools = $fpm_pools
$real_fpm_global_pool_settings = $fpm_global_pool_settings
if $manage_repos {
class { 'php::repo': }
-> Anchor['php::begin']
}
anchor { 'php::begin': }
-> class { 'php::packages': }
-> class { 'php::cli':
settings => $real_settings,
}
-> anchor { 'php::end': }
# Configure global PHP settings in php.ini
if $facts['os']['family'] != 'Debian' {
Class['php::packages']
-> class {'php::global':
settings => $real_settings,
}
-> Anchor['php::end']
}
if $fpm { contain 'php::fpm' }
if $embedded {
if $facts['os']['family'] == 'RedHat' and $fpm {
# Both fpm and embeded SAPIs are using same php.ini
fail('Enabling both cli and embedded sapis is not currently supported')
}
Anchor['php::begin']
-> class { 'php::embedded':
settings => $real_settings,
}
-> Anchor['php::end']
}
if $dev {
Anchor['php::begin']
-> class { 'php::dev': }
-> Anchor['php::end']
}
if $composer {
Anchor['php::begin']
-> class { 'php::composer':
proxy_type => $proxy_type,
proxy_server => $proxy_server,
}
-> Anchor['php::end']
}
if $pear {
Anchor['php::begin']
-> class { 'php::pear':
ensure => $pear_ensure,
}
-> Anchor['php::end']
}
if $phpunit {
Anchor['php::begin']
-> class { 'php::phpunit': }
-> Anchor['php::end']
}
if $apache_config {
Anchor['php::begin']
-> class { 'php::apache_config':
settings => $real_settings,
}
-> Anchor['php::end']
}
create_resources('php::extension', $real_extensions, {
require => Class['php::cli'],
before => Anchor['php::end']
})
# On FreeBSD purge the system-wide extensions.ini. It is going
# to be replaced with per-module configuration files.
if $facts['os']['family'] == 'FreeBSD' {
# Purge the system-wide extensions.ini
file { '/usr/local/etc/php/extensions.ini':
ensure => absent,
require => Class['php::packages'],
}
}
}

View File

@@ -1,38 +0,0 @@
# Install common PHP packages
#
# === Parameters
#
# [*ensure*]
# Specify which version of PHP packages to install
#
# [*names*]
# List of the names of the package to install
#
# [*names_to_prefix*]
# List of packages names that should be prefixed with the common
# package prefix `$php::package_prefix`
#
class php::packages (
String $ensure = $php::ensure,
Boolean $manage_repos = $php::manage_repos,
Array $names_to_prefix = prefix($php::params::common_package_suffixes, $php::package_prefix),
Array $names = $php::params::common_package_names,
) inherits php::params {
assert_private()
$real_names = union($names, $names_to_prefix)
if $facts['os']['family'] == 'debian' {
if $manage_repos {
include ::apt
Class['::apt::update'] -> Package[$real_names]
}
package { $real_names:
ensure => $ensure,
}
} else {
package { $real_names:
ensure => $ensure,
}
}
}

View File

@@ -1,220 +0,0 @@
# PHP params class
#
class php::params inherits php::globals {
$ensure = 'present'
$fpm_service_enable = true
$fpm_service_ensure = 'running'
$composer_source = 'https://getcomposer.org/composer.phar'
$composer_path = '/usr/local/bin/composer'
$composer_max_age = 30
$pear_ensure = 'present'
$pear_package_suffix = 'pear'
$phpunit_source = 'https://phar.phpunit.de/phpunit.phar'
$phpunit_path = '/usr/local/bin/phpunit'
$phpunit_max_age = 30
case $facts['os']['family'] {
'Debian': {
$config_root = $php::globals::globals_config_root
$config_root_ini = "${config_root}/mods-available"
$config_root_inifile = "${config_root}/php.ini"
$common_package_names = []
$common_package_suffixes = ['cli', 'common']
$cli_inifile = "${config_root}/cli/php.ini"
$dev_package_suffix = 'dev'
$fpm_pid_file = $php::globals::globals_fpm_pid_file
$fpm_config_file = "${config_root}/fpm/php-fpm.conf"
$fpm_error_log = $php::globals::fpm_error_log
$fpm_inifile = "${config_root}/fpm/php.ini"
$fpm_package_suffix = 'fpm'
$fpm_pool_dir = "${config_root}/fpm/pool.d"
$fpm_service_name = $php::globals::fpm_service_name
$fpm_user = 'www-data'
$fpm_group = 'www-data'
$apache_inifile = "${config_root}/apache2/php.ini"
$embedded_package_suffix = 'embed'
$embedded_inifile = "${config_root}/embed/php.ini"
$package_prefix = $php::globals::package_prefix
$compiler_packages = 'build-essential'
$root_group = 'root'
$ext_tool_enable = $php::globals::ext_tool_enable
$ext_tool_query = $php::globals::ext_tool_query
$ext_tool_enabled = true
case $facts['os']['name'] {
'Debian': {
$manage_repos = (versioncmp($facts['os']['release']['major'], '8') < 0)
}
'Ubuntu': {
$manage_repos = false
}
default: {
$manage_repos = false
}
}
}
'Suse': {
if ($php::globals::php_version != undef) {
$php_version_major = regsubst($php::globals::php_version, '^(\d+)\.(\d+)$','\1')
} else {
$php_version_major = 5
}
$config_root = $php::globals::globals_config_root
$config_root_ini = "${config_root}/conf.d"
$config_root_inifile = "${config_root}/php.ini"
$common_package_names = ["php${php_version_major}"]
$common_package_suffixes = []
$cli_inifile = "${config_root}/cli/php.ini"
$dev_package_suffix = 'devel'
$fpm_pid_file = $php::globals::globals_fpm_pid_file
$fpm_config_file = "${config_root}/fpm/php-fpm.conf"
$fpm_error_log = $php::globals::fpm_error_log
$fpm_inifile = "${config_root}/fpm/php.ini"
$fpm_package_suffix = 'fpm'
$fpm_pool_dir = "${config_root}/fpm/pool.d"
$fpm_service_name = 'php-fpm'
$fpm_user = 'wwwrun'
$fpm_group = 'www'
$embedded_package_suffix = 'embed'
$embedded_inifile = "${config_root}/embed/php.ini"
$package_prefix = $php::globals::package_prefix
$manage_repos = true
$root_group = 'root'
$ext_tool_enable = undef
$ext_tool_query = undef
$ext_tool_enabled = false
case $facts['os']['name'] {
'SLES': {
$compiler_packages = []
}
'OpenSuSE': {
$compiler_packages = 'devel_basis'
}
default: {
fail("Unsupported operating system ${facts['os']['name']}")
}
}
}
'RedHat': {
$config_root = $php::globals::globals_config_root
case $php::globals::rhscl_mode {
'remi': {
$config_root_ini = "${config_root}/php.d"
$config_root_inifile = "${config_root}/php.ini"
$cli_inifile = $config_root_inifile
$fpm_inifile = $config_root_inifile
$fpm_config_file = "${config_root}/php-fpm.conf"
$fpm_pool_dir = "${config_root}/php-fpm.d"
$php_bin_dir = "${php::globals::rhscl_root}/bin"
}
'rhscl': {
$config_root_ini = "${config_root}/php.d"
$config_root_inifile = "${config_root}/php.ini"
$cli_inifile = "${config_root}/php-cli.ini"
$fpm_inifile = "${config_root}/php-fpm.ini"
$fpm_config_file = "${config_root}/php-fpm.conf"
$fpm_pool_dir = "${config_root}/php-fpm.d"
$php_bin_dir = "${php::globals::rhscl_root}/bin"
}
undef: {
# no rhscl
$config_root_ini = $config_root
$config_root_inifile = '/etc/php.ini'
$cli_inifile = '/etc/php-cli.ini'
$fpm_inifile = '/etc/php-fpm.ini'
$fpm_config_file = '/etc/php-fpm.conf'
$fpm_pool_dir = '/etc/php-fpm.d'
}
default: {
fail("Unsupported rhscl_mode '${php::globals::rhscl_mode}'")
}
}
$apache_inifile = $config_root_inifile
$embedded_inifile = $config_root_inifile
$common_package_names = []
$common_package_suffixes = ['cli', 'common']
$dev_package_suffix = 'devel'
$fpm_pid_file = $php::globals::globals_fpm_pid_file
$fpm_error_log = '/var/log/php-fpm/error.log'
$fpm_package_suffix = 'fpm'
$fpm_service_name = pick($php::globals::fpm_service_name, 'php-fpm')
$fpm_user = 'apache'
$fpm_group = 'apache'
$embedded_package_suffix = 'embedded'
$package_prefix = pick($php::globals::package_prefix, 'php-')
$compiler_packages = ['gcc', 'gcc-c++', 'make']
$manage_repos = false
$root_group = 'root'
$ext_tool_enable = undef
$ext_tool_query = undef
$ext_tool_enabled = false
}
'FreeBSD': {
$config_root = $php::globals::globals_config_root
$config_root_ini = "${config_root}/php"
$config_root_inifile = "${config_root}/php.ini"
# No common packages, because the required PHP base package will be
# pulled in as a dependency. This preserves the ability to choose
# any available PHP version by setting the 'package_prefix' parameter.
$common_package_names = []
$common_package_suffixes = ['extensions']
$cli_inifile = "${config_root}/php-cli.ini"
$dev_package_suffix = undef
$fpm_pid_file = $php::globals::globals_fpm_pid_file
$fpm_config_file = "${config_root}/php-fpm.conf"
$fpm_error_log = '/var/log/php-fpm.log'
$fpm_inifile = "${config_root}/php-fpm.ini"
$fpm_package_suffix = undef
$fpm_pool_dir = "${config_root}/php-fpm.d"
$fpm_service_name = 'php-fpm'
$fpm_user = 'www'
$fpm_group = 'www'
$embedded_package_suffix = 'embed'
$embedded_inifile = "${config_root}/php-embed.ini"
$package_prefix = 'php56-'
$compiler_packages = ['gcc']
$manage_repos = false
$root_group = 'wheel'
$ext_tool_enable = undef
$ext_tool_query = undef
$ext_tool_enabled = false
}
'Archlinux': {
$config_root_ini = '/etc/php/conf.d'
$config_root_inifile = '/etc/php/php.ini'
$common_package_names = []
$common_package_suffixes = []
$cli_inifile = '/etc/php/php.ini'
$dev_package_suffix = undef
$fpm_pid_file = '/run/php-fpm/php-fpm.pid'
$fpm_config_file = '/etc/php/php-fpm.conf'
$fpm_error_log = 'syslog'
$fpm_inifile = '/etc/php/php.ini'
$fpm_package_suffix = 'fpm'
$fpm_pool_dir = '/etc/php/php-fpm.d'
$fpm_service_name = 'php-fpm'
$fpm_user = 'root'
$fpm_group = 'root'
$apache_inifile = '/etc/php/php.ini'
$embedded_package_suffix = 'embedded'
$embedded_inifile = '/etc/php/php.ini'
$package_prefix = 'php-'
$compiler_packages = ['gcc', 'make']
$manage_repos = false
$root_group = 'root'
$ext_tool_enable = undef
$ext_tool_query = undef
$ext_tool_enabled = false
}
default: {
fail("Unsupported osfamily: ${facts['os']['family']}")
}
}
}

View File

@@ -1,70 +0,0 @@
# Install PEAR package manager
#
# === Parameters
#
# [*ensure*]
# The package ensure of PHP pear to install and run pear auto_discover
#
# [*package*]
# The package name for PHP pear
#
class php::pear (
String $ensure = $php::pear_ensure,
Optional[String] $package = undef,
Boolean $manage_repos = $php::manage_repos,
) inherits php::params {
assert_private()
# Defaults for the pear package name
if $package {
$package_name = $package
} else {
if $facts['os']['name'] == 'Amazon' {
# On Amazon Linux the package name is also just 'php-pear'.
# This would normally not be problematic but if you specify a
# package_prefix other than 'php' then it will fail.
$package_name = "php-${::php::params::pear_package_suffix}"
}
else {
case $facts['os']['family'] {
'Debian': {
# Debian is a litte stupid: The pear package is called 'php-pear'
# even though others are called 'php5-fpm' or 'php5-dev'
$package_name = "php-${::php::params::pear_package_suffix}"
}
'FreeBSD': {
# On FreeBSD the package name is just 'pear'.
$package_name = $php::params::pear_package_suffix
}
default: {
# This is the default for all other architectures
$package_name = "${::php::package_prefix}${::php::params::pear_package_suffix}"
}
}
}
}
# the apt module provides apt::update. apt is only included if we manage any repos
$require = $manage_repos ? {
true => Class['::apt::update'],
false => undef,
}
# Default PHP come with xml module and no seperate package for it
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['full'], '16.04') >= 0 {
ensure_packages(["${php::package_prefix}xml"], {
ensure => present,
require => $require,
})
package { $package_name:
ensure => $ensure,
require => [$require,Class['php::cli'],Package["${php::package_prefix}xml"]],
}
} else {
package { $package_name:
ensure => $ensure,
require => Class['php::cli'],
}
}
}

View File

@@ -1,48 +0,0 @@
# Install phpunit, PHP testing framework
#
# === Parameters
#
# [*source*]
# Holds URL to the phpunit source file
#
# [*path*]
# Holds path to the phpunit executable
#
# [*auto_update*]
# Defines if phpunit should be auto updated
#
# [*max_age*]
# Defines the time in days after which an auto-update gets executed
#
class php::phpunit (
String $source = $php::params::phpunit_source,
Stdlib::Absolutepath $path = $php::params::phpunit_path,
String[1] $root_group = $php::params::root_group,
Boolean $auto_update = true,
Integer $max_age = $php::params::phpunit_max_age,
) inherits php::params {
assert_private()
ensure_packages(['wget'])
exec { 'download phpunit':
command => "wget ${source} -O ${path}",
creates => $path,
path => ['/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin', '/usr/local/sbin'],
require => [Class['php::cli'],Package['wget']],
}
-> file { $path:
mode => '0555',
owner => root,
group => $root_group,
}
if $auto_update {
class { 'php::phpunit::auto_update':
max_age => $max_age,
source => $source,
path => $path,
}
}
}

View File

@@ -1,28 +0,0 @@
# Install phpunit package manager
#
# === Parameters
#
# [*max_age*]
# Defines number of days after which phpunit should be updated
#
# [*source*]
# Holds URL to the phpunit source file
#
# [*path*]
# Holds path to the phpunit executable
#
class php::phpunit::auto_update (
$max_age,
$source,
$path,
) {
assert_private()
exec { 'update phpunit':
command => "wget ${source} -O ${path}",
onlyif => "test `find '${path}' -mtime +${max_age}`",
path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin', '/usr/local/sbin' ],
require => File[$path],
}
}

View File

@@ -1,33 +0,0 @@
# Configure package repository
#
class php::repo {
$msg_no_repo = "No repo available for ${facts['os']['family']}/${facts['os']['name']}"
case $facts['os']['family'] {
'Debian': {
# no contain here because apt does that already
case $facts['os']['name'] {
'Debian': {
include ::php::repo::debian
}
'Ubuntu': {
include ::php::repo::ubuntu
}
default: {
fail($msg_no_repo)
}
}
}
'FreeBSD': {}
'Suse': {
contain ::php::repo::suse
}
'RedHat': {
contain 'php::repo::redhat'
}
default: {
fail($msg_no_repo)
}
}
}

View File

@@ -1,99 +0,0 @@
# Configure debian apt repo
#
# === Parameters
#
# [*location*]
# Location of the apt repository
#
# [*release*]
# Release of the apt repository
#
# [*repos*]
# Apt repository names
#
# [*include_src*]
# Add source source repository
#
# [*key*]
# Public key in apt::key format
#
# [*dotdeb*]
# Enable special dotdeb handling
#
# [*sury*]
# Enable special sury handling
#
class php::repo::debian(
$location = 'https://packages.dotdeb.org',
$release = 'wheezy-php56',
$repos = 'all',
$include_src = false,
$key = {
'id' => '6572BBEF1B5FF28B28B706837E3F070089DF5277',
'source' => 'http://www.dotdeb.org/dotdeb.gpg',
},
$dotdeb = true,
$sury = true,
) {
assert_private()
include '::apt'
create_resources(::apt::key, { 'php::repo::debian' => {
id => $key['id'],
source => $key['source'],
}})
::apt::source { "source_php_${release}":
location => $location,
release => $release,
repos => $repos,
include => {
'src' => $include_src,
'deb' => true,
},
require => Apt::Key['php::repo::debian'],
}
if ($dotdeb) {
# both repositories are required to work correctly
# See: http://www.dotdeb.org/instructions/
if $release == 'wheezy-php56' {
::apt::source { 'dotdeb-wheezy':
location => $location,
release => 'wheezy',
repos => $repos,
include => {
'src' => $include_src,
'deb' => true,
},
}
}
}
if ($sury and $php::globals::php_version == '7.1') {
# Required packages for PHP 7.1 repository
ensure_packages(['lsb-release', 'ca-certificates'], {'ensure' => 'present'})
# Add PHP 7.1 key + repository
apt::key { 'php::repo::debian-php71':
id => 'DF3D585DB8F0EB658690A554AC0E47584A7A714D',
source => 'https://packages.sury.org/php/apt.gpg',
}
::apt::source { 'source_php_71':
location => 'https://packages.sury.org/php/',
release => $facts['os']['distro']['codename'],
repos => 'main',
include => {
'src' => $include_src,
'deb' => true,
},
require => [
Apt::Key['php::repo::debian-php71'],
Package['apt-transport-https', 'lsb-release', 'ca-certificates']
],
}
}
}

View File

@@ -1,35 +0,0 @@
# Configure a yum repo for RedHat-based systems
#
# === Parameters
#
# [*yum_repo*]
# Class name of the repo under ::yum::repo
#
class php::repo::redhat (
$yum_repo = 'remi_php56',
) {
$releasever = $facts['os']['name'] ? {
/(?i:Amazon)/ => '6',
default => '$releasever', # Yum var
}
yumrepo { 'remi':
descr => 'Remi\'s RPM repository for Enterprise Linux $releasever - $basearch',
mirrorlist => "https://rpms.remirepo.net/enterprise/${releasever}/remi/mirror",
enabled => 1,
gpgcheck => 1,
gpgkey => 'https://rpms.remirepo.net/RPM-GPG-KEY-remi',
priority => 1,
}
yumrepo { 'remi-php56':
descr => 'Remi\'s PHP 5.6 RPM repository for Enterprise Linux $releasever - $basearch',
mirrorlist => "https://rpms.remirepo.net/enterprise/${releasever}/php56/mirror",
enabled => 1,
gpgcheck => 1,
gpgkey => 'https://rpms.remirepo.net/RPM-GPG-KEY-remi',
priority => 1,
}
}

View File

@@ -1,25 +0,0 @@
# Configure suse repo
#
# === Parameters
#
# [*reponame*]
# Name of the Zypper repository
#
# [*baseurl*]
# Base URL of the Zypper repository
#
class php::repo::suse (
$reponame = 'mayflower-php56',
$baseurl = 'http://download.opensuse.org/repositories/home:/mayflower:/php5.6_based/SLE_11_SP3/',
) {
zypprepo { $reponame:
baseurl => $baseurl,
enabled => 1,
autorefresh => 1,
}
~> exec { 'zypprepo-accept-key':
command => 'zypper --gpg-auto-import-keys update -y',
path => '/usr/bin:/bin',
refreshonly => true,
}
}

View File

@@ -1,33 +0,0 @@
# Configure ubuntu ppa
#
# === Parameters
#
# [*version*]
# PHP version to manage (e.g. 5.6)
#
class php::repo::ubuntu (
$version = undef,
) {
include '::apt'
if($version == undef) {
$version_real = '5.6'
} else {
$version_real = $version
}
if ($version_real == '5.5') {
fail('PHP 5.5 is no longer available for download')
}
assert_type(Pattern[/^\d\.\d/], $version_real)
$version_repo = $version_real ? {
'5.4' => 'ondrej/php5-oldstable',
'5.6' => 'ondrej/php',
'7.0' => 'ondrej/php'
}
::apt::ppa { "ppa:${version_repo}":
package_manage => true,
}
}

View File

@@ -1,91 +0,0 @@
{
"name": "puppet-php",
"version": "6.0.1",
"author": "Vox Pupuli",
"summary": "Generic PHP module that supports many platforms",
"license": "MIT",
"source": "https://github.com/voxpupuli/puppet-php",
"project_page": "https://github.com/voxpupuli/puppet-php",
"issues_url": "https://github.com/voxpupuli/puppet-php/issues",
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.16.0 < 6.0.0"
},
{
"name": "puppetlabs/apt",
"version_requirement": ">= 4.4.0 < 7.0.0"
},
{
"name": "puppetlabs/inifile",
"version_requirement": ">= 1.4.1 < 3.0.0"
},
{
"name": "puppet/zypprepo",
"version_requirement": ">= 2.0.0 < 3.0.0"
},
{
"name": "puppet/archive",
"version_requirement": ">= 1.0.0 < 4.0.0"
}
],
"data_provider": null,
"description": "Puppet module that aims to manage PHP and extensions in a generic way on many platforms with sane defaults and easy configuration",
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.10.0 < 7.0.0"
}
],
"operatingsystem_support": [
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04",
"18.04"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "FreeBSD",
"operatingsystemrelease": [
"9",
"10",
"11"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11"
]
},
{
"operatingsystem": "OpenSUSE"
},
{
"operatingsystem": "Archlinux"
}
]
}

View File

@@ -1,3 +0,0 @@
ensure_packages(['php-mysql','libapache2-mod-php'])
class { '::php': }

View File

@@ -1,33 +0,0 @@
<?xml version="1.0"?>
<utility xmlns="http://www.github/cliffe/SecGen/utility"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.github/cliffe/SecGen/utility">
<name>PHP Server - Stretch / Kali Compatible</name>
<author>Thomas Shaw</author>
<author>Vox Pupuli</author>
<module_license>Apache v2</module_license>
<description>An installation of PHP for Stretch / Kali</description>
<type>web_server</type>
<platform>linux</platform>
<!--optional details-->
<reference>http://php.net</reference>
<reference>https://forge.puppet.com/puppet/php</reference>
<software_name>php</software_name>
<software_license>PHP License v3.01</software_license>
<conflict>
<name>.*Wheezy.*</name>
</conflict>
<requires>
<type>update</type>
</requires>
<requires>
<module_path>.*apache_stretch.*</module_path>
</requires>
<requires>
<module_path>.*mysql_stretch.*</module_path>
</requires>
</utility>

View File

@@ -1,13 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
archlinux-2-x64:
roles:
- master
platform: archlinux-2-x64
box: archlinux/archlinux
hypervisor: vagrant
CONFIG:
type: foss

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-511-x64:
roles:
- master
platform: el-5-x86_64
box: puppetlabs/centos-5.11-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-6-x64:
roles:
- master
platform: el-6-x86_64
box: centos/6
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml

View File

@@ -1,17 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-66-x64:
roles:
- master
- database
- dashboard
platform: el-6-x86_64
box: puppetlabs/centos-6.6-64-puppet-enterprise
hypervisor: vagrant
CONFIG:
type: pe
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-66-x64:
roles:
- master
platform: el-6-x86_64
box: puppetlabs/centos-6.6-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-7-x64:
roles:
- master
platform: el-7-x86_64
box: centos/7
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
centos-72-x64:
roles:
- master
platform: el-7-x86_64
box: puppetlabs/centos-7.2-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
debian-78-x64:
roles:
- master
platform: debian-7-amd64
box: puppetlabs/debian-7.8-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
debian-82-x64:
roles:
- master
platform: debian-8-amd64
box: puppetlabs/debian-8.2-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,31 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# Additional ~/.fog config file with AWS EC2 credentials
# required.
#
# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
#
# Amazon Linux is not a RHEL clone.
#
HOSTS:
amazonlinux-2016091-x64:
roles:
- master
platform: centos-6-x86_64
hypervisor: ec2
# refers to image_tempaltes.yaml AMI[vmname] entry:
vmname: amazonlinux-2016091-eu-central-1
# refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
snapshot: aio
# t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
amisize: t2.micro
# required so that beaker sanitizes sshd_config and root authorized_keys:
user: ec2-user
CONFIG:
type: aio
:ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
...
# vim: syntax=yaml

View File

@@ -1,34 +0,0 @@
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# see also: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
#
# Hint: image IDs (ami-*) for the same image are different per location.
#
AMI:
# Amazon Linux AMI 2016.09.1 (HVM), SSD Volume Type
amazonlinux-2016091-eu-central-1:
:image:
:aio: ami-af0fc0c0
:region: eu-central-1
# Red Hat Enterprise Linux 7.3 (HVM), SSD Volume Type
rhel-73-eu-central-1:
:image:
:aio: ami-e4c63e8b
:region: eu-central-1
# SUSE Linux Enterprise Server 12 SP2 (HVM), SSD Volume Type
sles-12sp2-eu-central-1:
:image:
:aio: ami-c425e4ab
:region: eu-central-1
# Ubuntu Server 16.04 LTS (HVM), SSD Volume Type
ubuntu-1604-eu-central-1:
:image:
:aio: ami-fe408091
:region: eu-central-1
# Microsoft Windows Server 2016 Base
windows-2016-base-eu-central-1:
:image:
:aio: ami-88ec20e7
:region: eu-central-1

View File

@@ -1,29 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# Additional ~/.fog config file with AWS EC2 credentials
# required.
#
# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
#
HOSTS:
rhel-73-x64:
roles:
- master
platform: el-7-x86_64
hypervisor: ec2
# refers to image_tempaltes.yaml AMI[vmname] entry:
vmname: rhel-73-eu-central-1
# refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
snapshot: aio
# t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
amisize: t2.micro
# required so that beaker sanitizes sshd_config and root authorized_keys:
user: ec2-user
CONFIG:
type: aio
:ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
...
# vim: syntax=yaml

View File

@@ -1,29 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# Additional ~/.fog config file with AWS EC2 credentials
# required.
#
# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
#
HOSTS:
sles-12sp2-x64:
roles:
- master
platform: sles-12-x86_64
hypervisor: ec2
# refers to image_tempaltes.yaml AMI[vmname] entry:
vmname: sles-12sp2-eu-central-1
# refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
snapshot: aio
# t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
amisize: t2.micro
# required so that beaker sanitizes sshd_config and root authorized_keys:
user: ec2-user
CONFIG:
type: aio
:ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
...
# vim: syntax=yaml

View File

@@ -1,29 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# Additional ~/.fog config file with AWS EC2 credentials
# required.
#
# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
#
HOSTS:
ubuntu-1604-x64:
roles:
- master
platform: ubuntu-16.04-amd64
hypervisor: ec2
# refers to image_tempaltes.yaml AMI[vmname] entry:
vmname: ubuntu-1604-eu-central-1
# refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
snapshot: aio
# t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
amisize: t2.micro
# required so that beaker sanitizes sshd_config and root authorized_keys:
user: ubuntu
CONFIG:
type: aio
:ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
...
# vim: syntax=yaml

View File

@@ -1,29 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# Additional ~/.fog config file with AWS EC2 credentials
# required.
#
# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md
#
HOSTS:
windows-2016-base-x64:
roles:
- master
platform: windows-2016-64
hypervisor: ec2
# refers to image_tempaltes.yaml AMI[vmname] entry:
vmname: windows-2016-base-eu-central-1
# refers to image_tempaltes.yaml entry inside AMI[vmname][:image]:
snapshot: aio
# t2.micro is free tier eligible (https://aws.amazon.com/en/free/):
amisize: t2.micro
# required so that beaker sanitizes sshd_config and root authorized_keys:
user: ec2-user
CONFIG:
type: aio
:ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
fedora-24-x64:
roles:
- master
platform: fedora-24-x86_64
box: fedora/24-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml

View File

@@ -1,16 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
HOSTS:
fedora-25-x64:
roles:
- master
platform: fedora-25-x86_64
box: fedora/25-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml

View File

@@ -1,16 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
HOSTS:
fedora-26-x64:
roles:
- master
platform: fedora-26-x86_64
box: fedora/26-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml

View File

@@ -1,18 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# platform is fedora 26 because there is no puppet-agent
# for fedora 27 as of 2017-11-17
HOSTS:
fedora-27-x64:
roles:
- master
platform: fedora-26-x86_64
box: fedora/27-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
ubuntu-server-1204-x64:
roles:
- master
platform: ubuntu-12.04-amd64
box: puppetlabs/ubuntu-12.04-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
ubuntu-server-1404-x64:
roles:
- master
platform: ubuntu-14.04-amd64
box: puppetlabs/ubuntu-14.04-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,15 +0,0 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
HOSTS:
ubuntu-server-1604-x64:
roles:
- master
platform: ubuntu-16.04-amd64
box: puppetlabs/ubuntu-16.04-64-nocm
hypervisor: vagrant
CONFIG:
type: foss
...
# vim: syntax=yaml

View File

@@ -1,47 +0,0 @@
require 'spec_helper_acceptance'
describe 'with specific php version' do
case default[:platform]
when %r{ubuntu}
packagename = 'php5.6-fpm'
when %r{el}
# ell = Enterprise Linux = CentOS....
packagename = 'php-fpm'
when %r{debian}
packagename = 'php5-fpm'
end
context 'with params' do
it 'works with 5.6' do
pp = <<-EOS
class { 'php::globals':
php_version => '5.6',
}
-> class { 'php':
ensure => 'present',
manage_repos => true,
fpm => true,
dev => true,
composer => true,
pear => true,
phpunit => false,
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
describe package(packagename) do
it { is_expected.to be_installed }
end
describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
describe command('php --version') do
its(:stdout) { is_expected.to match %r{5\.6} }
end
end
end

View File

@@ -1,96 +0,0 @@
require 'spec_helper_acceptance'
describe 'php with default settings' do
context 'default parameters' do
it 'works with defaults' do
pp = 'include php'
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
case default[:platform]
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
packagename = 'php7.0-fpm'
when %r{ubuntu-14.04}
packagename = 'php5-fpm'
when %r{el}
packagename = 'php-fpm'
when %r{debian-8}
packagename = 'php5-fpm'
when %r{debian-9}
packagename = 'php7.0-fpm'
end
describe package(packagename) do
it { is_expected.to be_installed }
end
describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
end
context 'default parameters with extensions' do
case default[:platform]
when %r{ubuntu-18.04}, %r{ubuntu-16.04}, %r{ubuntu-14.04}
it 'works with defaults' do
pp = <<-EOS
class{'php':
extensions => {
'mysql' => {},
'gd' => {},
'net-url' => {
package_prefix => 'php-',
settings => {
extension => undef
}
}
}
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
else
it 'works with defaults' do
pp = <<-EOS
class{'php':
extensions => {
'mysql' => {},
'gd' => {}
}
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end
end
case default[:platform]
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
packagename = 'php7.0-fpm'
when %r{ubuntu-14.04}
packagename = 'php5-fpm'
when %r{el}
packagename = 'php-fpm'
when %r{debian-8}
packagename = 'php5-fpm'
when %r{debian-9}
packagename = 'php7.0-fpm'
end
describe package(packagename) do
it { is_expected.to be_installed }
end
describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
end
end

View File

@@ -1,4 +0,0 @@
require 'rspec-puppet'
at_exit { RSpec::Puppet::Coverage.report! }
# vim: syntax=ruby

View File

@@ -1,41 +0,0 @@
require 'rspec'
require 'spec_helper'
describe 'php::fpm::config' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
describe 'creates config file' do
let(:params) do
{
inifile: '/etc/php5/conf.d/unique-name.ini',
settings: {
'apc.enabled' => 1
}
}
end
it do
is_expected.to contain_class('php::fpm::config').with(
inifile: '/etc/php5/conf.d/unique-name.ini',
settings: {
'apc.enabled' => 1
}
)
end
it do
is_expected.to contain_php__config('fpm').with(
file: '/etc/php5/conf.d/unique-name.ini',
config: {
'apc.enabled' => 1
}
)
end
end
end
end
end

View File

@@ -1,34 +0,0 @@
require 'spec_helper'
describe 'php::fpm::service', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'class {"php": fpm => true}' }
describe 'when called with no parameters' do
# rubocop:disable RSpec/RepeatedExample
case facts[:osfamily]
when 'Debian'
case facts[:operatingsystemrelease]
when '12.04'
it { is_expected.to contain_service('php5-fpm').with_ensure('running').without_restart }
when '14.04'
it { is_expected.to contain_service('php5-fpm').with_restart('service php5-fpm reload').with_ensure('running') }
when '16.04'
it { is_expected.to contain_service('php7.0-fpm').with_ensure('running') }
end
when 'Suse'
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
when 'FreeBSD'
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
else
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
end
end
end
end
end

View File

@@ -1,46 +0,0 @@
require 'spec_helper'
describe 'php::fpm', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'class {"php": fpm => false}' }
describe 'when called with no parameters' do
# rubocop:disable RSpec/RepeatedExample
case facts[:osfamily]
when 'Debian'
case facts[:operatingsystemrelease]
when '14.04'
it { is_expected.to contain_file('/etc/init/php5-fpm.override').with_content('reload signal USR2') }
it { is_expected.to contain_package('php5-fpm').with_ensure('present') }
it { is_expected.to contain_service('php5-fpm').with_ensure('running') }
when '12.02'
it { is_expected.to contain_file('/etc/init/php5-fpm.override').with_content("reload signal USR2\nmanual") }
it { is_expected.to contain_package('php5-fpm').with_ensure('present') }
it { is_expected.to contain_service('php5-fpm').with_ensure('running') }
when '16.04'
it { is_expected.to contain_package('php7.0-fpm').with_ensure('present') }
it { is_expected.to contain_service('php7.0-fpm').with_ensure('running') }
end
when 'Suse'
it { is_expected.to contain_package('php5-fpm').with_ensure('present') }
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
when 'FreeBSD'
it { is_expected.not_to contain_package('php56-') }
it { is_expected.not_to contain_package('php5-fpm') }
it { is_expected.not_to contain_package('php-fpm') }
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
else
it { is_expected.to contain_package('php-fpm').with_ensure('present') }
it { is_expected.to contain_service('php-fpm').with_ensure('running') }
end
# rubocop:enable RSpec/RepeatedExample
it { is_expected.to contain_class('php::fpm::config').that_notifies('Class[php::fpm::service]') }
it { is_expected.to contain_class('php::fpm::service') }
end
end
end
end

View File

@@ -1,31 +0,0 @@
require 'spec_helper'
describe 'php::repo', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let :pre_condition do
'include php'
end
describe 'when configuring a package repo' do
case facts[:osfamily]
when 'Debian'
case facts[:operatingsystem]
when 'Debian'
it { is_expected.to contain_class('php::repo::debian') }
when 'Ubuntu'
it { is_expected.to contain_class('php::repo::ubuntu') }
end
when 'Suse'
it { is_expected.to contain_class('php::repo::suse') }
when 'RedHat'
it { is_expected.to contain_class('php::repo::redhat') }
end
end
end
end
end

View File

@@ -1,49 +0,0 @@
require 'spec_helper'
describe 'php::repo::ubuntu', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
case facts[:lsbdistcodename]
when 'trusty'
describe 'when called with no parameters on Ubuntu trusty' do
it { is_expected.to contain_exec('add-apt-repository-ppa:ondrej/php') }
end
describe 'when called with version 7.0 on Ubuntu trusty' do
let(:params) do
{
version: '7.0'
}
end
it { is_expected.to contain_exec('add-apt-repository-ppa:ondrej/php') }
end
describe 'when call with version 5.6 on Ubuntu trusty' do
let(:params) do
{
version: '5.6'
}
end
it { is_expected.to contain_exec('add-apt-repository-ppa:ondrej/php') }
end
describe 'when call with version 5.4 on Ubuntu trusty' do
let(:params) do
{
version: '5.4'
}
end
it { expect { is_expected.to raise_error(Puppet::Error) } }
end
end
end
end
end

View File

@@ -1,265 +0,0 @@
require 'spec_helper'
describe 'php', type: :class do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
php_cli_package = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '9'
'php7.0-cli'
else
'php5-cli'
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '18.04'
'php7.2-cli'
when '16.04'
'php7.0-cli'
else
'php5-cli'
end
end
php_fpm_ackage = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '9'
'php7.0-fpm'
else
'php5-fpm'
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '18.04'
'php7.2-fpm'
when '16.04'
'php7.0-fpm'
else
'php5-fpm'
end
end
php_dev_ackage = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '9'
'php7.0-dev'
else
'php5-dev'
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '18.04'
'php7.2-dev'
when '16.04'
'php7.0-dev'
else
'php5-dev'
end
end
describe 'when called with no parameters' do
case facts[:osfamily]
when 'Suse', 'RedHat', 'CentOS'
it { is_expected.to contain_class('php::global') }
end
case facts[:osfamily]
when 'Debian'
it { is_expected.not_to contain_class('php::global') }
it { is_expected.to contain_class('php::fpm') }
it { is_expected.to contain_package('php-pear').with_ensure('present') }
it { is_expected.to contain_class('php::composer') }
it { is_expected.to contain_package(php_cli_package).with_ensure('present') }
it { is_expected.to contain_package(php_fpm_ackage).with_ensure('present') }
it { is_expected.to contain_package(php_dev_ackage).with_ensure('present') }
when 'Suse'
it { is_expected.to contain_package('php5').with_ensure('present') }
it { is_expected.to contain_package('php5-devel').with_ensure('present') }
it { is_expected.to contain_package('php5-pear').with_ensure('present') }
it { is_expected.not_to contain_package('php5-cli') }
it { is_expected.not_to contain_package('php5-dev') }
it { is_expected.not_to contain_package('php-pear') }
when 'RedHat', 'CentOS'
it { is_expected.to contain_package('php-cli').with_ensure('present') }
it { is_expected.to contain_package('php-common').with_ensure('present') }
end
end
describe 'when called with package_prefix parameter' do
package_prefix = 'myphp-'
let(:params) { { package_prefix: package_prefix } }
case facts[:osfamily]
when 'Suse', 'RedHat', 'CentOS'
it { is_expected.to contain_class('php::global') }
end
case facts[:osfamily]
when 'Debian', 'RedHat', 'CentOS'
it { is_expected.to contain_package("#{package_prefix}cli").with_ensure('present') }
end
case facts[:osfamily]
when 'Debian'
it { is_expected.not_to contain_class('php::global') }
it { is_expected.to contain_class('php::fpm') }
it { is_expected.to contain_class('php::composer') }
it { is_expected.to contain_package('php-pear').with_ensure('present') }
it { is_expected.to contain_package("#{package_prefix}dev").with_ensure('present') }
it { is_expected.to contain_package("#{package_prefix}fpm").with_ensure('present') }
when 'Suse'
it { is_expected.to contain_package('php5').with_ensure('present') }
it { is_expected.to contain_package("#{package_prefix}devel").with_ensure('present') }
it { is_expected.to contain_package("#{package_prefix}pear").with_ensure('present') }
it { is_expected.not_to contain_package("#{package_prefix}cli").with_ensure('present') }
it { is_expected.not_to contain_package("#{package_prefix}dev") }
it { is_expected.not_to contain_package('php-pear') }
when 'RedHat', 'CentOS'
it { is_expected.to contain_package("#{package_prefix}common").with_ensure('present') }
end
end
describe 'when called with fpm_user parameter' do
let(:params) { { fpm_user: 'nginx' } }
it { is_expected.to contain_class('php::fpm').with(user: 'nginx') }
it { is_expected.to contain_php__fpm__pool('www').with(user: 'nginx') }
dstfile = case facts[:osfamily]
when 'Debian'
case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '9'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
end
when 'Archlinux'
'/etc/php/php-fpm.d/www.conf'
when 'Suse'
'/etc/php5/fpm/pool.d/www.conf'
when 'RedHat'
'/etc/php-fpm.d/www.conf'
when 'FreeBSD'
'/usr/local/etc/php-fpm.d/www.conf'
end
it { is_expected.to contain_file(dstfile).with_content(%r{user = nginx}) }
end
describe 'when called with fpm_group parameter' do
let(:params) { { fpm_group: 'nginx' } }
it { is_expected.to contain_class('php::fpm').with(group: 'nginx') }
it { is_expected.to contain_php__fpm__pool('www').with(group: 'nginx') }
dstfile = case facts[:osfamily]
when 'Debian'
case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '9'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '18.04'
'/etc/php/7.2/fpm/pool.d/www.conf'
when '16.04'
'/etc/php/7.0/fpm/pool.d/www.conf'
else
'/etc/php5/fpm/pool.d/www.conf'
end
end
when 'Archlinux'
'/etc/php/php-fpm.d/www.conf'
when 'Suse'
'/etc/php5/fpm/pool.d/www.conf'
when 'RedHat'
'/etc/php-fpm.d/www.conf'
when 'FreeBSD'
'/usr/local/etc/php-fpm.d/www.conf'
end
it { is_expected.to contain_file(dstfile).with_content(%r{group = nginx}) }
end
describe 'when fpm is disabled' do
let(:params) { { fpm: false } }
it { is_expected.not_to contain_class('php::fpm') }
end
describe 'when composer is disabled' do
let(:params) { { composer: false } }
it { is_expected.not_to contain_class('php::composer') }
end
if facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS'
describe 'when called with global option for rhscl_mode' do
describe 'when called with mode "remi"' do
scl_php_version = 'php56'
rhscl_mode = 'remi'
let(:pre_condition) do
"class {'::php::globals':
php_version => '#{scl_php_version}',
rhscl_mode => '#{rhscl_mode}'
}"
end
let(:params) do
{ settings: { 'Date/date.timezone' => 'Europe/Berlin' } }
end
it { is_expected.to contain_class('php::global') }
it { is_expected.to contain_package("#{scl_php_version}-php-cli").with_ensure('present') }
it { is_expected.to contain_package("#{scl_php_version}-php-common").with_ensure('present') }
it { is_expected.to contain_php__config('global').with(file: "/etc/opt/#{rhscl_mode}/#{scl_php_version}/php.ini") }
it { is_expected.not_to contain_php__config('cli') }
# see: https://github.com/voxpupuli/puppet-php/blob/master/lib/puppet/parser/functions/to_hash_settings.rb
it { is_expected.to contain_php__config__setting("/etc/opt/#{rhscl_mode}/#{scl_php_version}/php.ini: Date/date.timezone").with_value('Europe/Berlin') }
end
describe 'when called with mode "rhscl"' do
scl_php_version = 'rh-php56'
rhscl_mode = 'rhscl'
let(:pre_condition) do
"class {'::php::globals':
php_version => '#{scl_php_version}',
rhscl_mode => '#{rhscl_mode}'
}"
end
let(:params) do
{ settings: { 'Date/date.timezone' => 'Europe/Berlin' } }
end
it { is_expected.to contain_class('php::global') }
it { is_expected.to contain_package("#{scl_php_version}-php-cli").with_ensure('present') }
it { is_expected.to contain_package("#{scl_php_version}-php-common").with_ensure('present') }
it { is_expected.to contain_php__config('global').with(file: "/etc/opt/rh/#{scl_php_version}/php.ini") }
it { is_expected.to contain_php__config('cli').with(file: "/etc/opt/rh/#{scl_php_version}/php-cli.ini") }
it { is_expected.to contain_php__config__setting("/etc/opt/rh/#{scl_php_version}/php.ini: Date/date.timezone").with_value('Europe/Berlin') }
end
end
end
end
end
end

View File

@@ -1,14 +0,0 @@
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# use default_module_facts.yaml for module specific
# facts.
#
# Hint if using with rspec-puppet-facts ("on_supported_os.each"):
# if a same named fact exists in facterdb it will be overridden.
---
concat_basedir: "/tmp"
ipaddress: "172.16.254.254"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"

View File

@@ -1,114 +0,0 @@
require 'spec_helper'
describe 'php::config' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
case facts[:operatingsystem]
when 'Ubuntu'
context 'default config' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php/5.6/conf.d/unique-name.ini',
config: {}
}
end
it { is_expected.to compile }
end
context 'simple example' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php/5.6/conf.d/unique-name.ini',
config: {
'apc.enabled' => 1
}
}
end
it { is_expected.to contain_php__config('unique-name').with_file('/etc/php/5.6/conf.d/unique-name.ini') }
end
context 'empty array' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php/5.6/conf.d/unique-name.ini',
config: {}
}
end
it { is_expected.to contain_php__config('unique-name').with_file('/etc/php/5.6/conf.d/unique-name.ini') }
end
context 'invalid config (string)' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php/5.6/conf.d/unique-name.ini',
config: 'hello world'
}
end
it { expect { is_expected.to raise_error(Puppet::Error) } }
end
else
context 'default config' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php5/conf.d/unique-name.ini',
config: {}
}
end
it { is_expected.to compile }
end
context 'simple example' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php5/conf.d/unique-name.ini',
config: {
'apc.enabled' => 1
}
}
end
it { is_expected.to contain_php__config('unique-name').with_file('/etc/php5/conf.d/unique-name.ini') }
end
context 'empty array' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php5/conf.d/unique-name.ini',
config: {}
}
end
it { is_expected.to contain_php__config('unique-name').with_file('/etc/php5/conf.d/unique-name.ini') }
end
context 'invalid config (string)' do
let(:title) { 'unique-name' }
let(:params) do
{
file: '/etc/php5/conf.d/unique-name.ini',
config: 'hello world'
}
end
it { expect { is_expected.to raise_error(Puppet::Error) } }
end
end
end
end
end

View File

@@ -1,53 +0,0 @@
require 'spec_helper'
describe 'php::extension' do
on_supported_os.each do |os, facts|
next unless facts[:osfamily] == 'RedHat' || facts[:osfamily] == 'CentOS'
context "on #{os}" do
let :facts do
facts
end
describe 'with rhscl_mode "remi" enabled: install one extension' do
scl_php_version = 'php56'
rhscl_mode = 'remi'
configs_root = "/etc/opt/#{rhscl_mode}/#{scl_php_version}"
let(:pre_condition) do
"class {'::php::globals':
php_version => '#{scl_php_version}',
rhscl_mode => '#{rhscl_mode}'
}->
class {'::php':
ensure => installed,
manage_repos => false,
fpm => false,
dev => true, # must be true since we are using the provider => pecl (option installs header files)
composer => false,
pear => true,
phpunit => false,
}"
end
let(:title) { 'soap' }
let(:params) do
{
ini_prefix: '20-',
settings: {
'bz2' => {
'Date/date.timezone' => 'Europe/Berlin'
}
},
multifile_settings: true
}
end
it { is_expected.to contain_class('php::global') }
it { is_expected.to contain_class('php') }
it { is_expected.to contain_php__config('bz2').with(file: "#{configs_root}/php.d/20-bz2.ini") }
it { is_expected.to contain_php__config__setting("#{configs_root}/php.d/20-bz2.ini: Date/date.timezone").with_value('Europe/Berlin') }
end
end
end
end

View File

@@ -1,230 +0,0 @@
require 'spec_helper'
describe 'php::extension' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include php' }
unless facts[:osfamily] == 'Suse' || facts[:osfamily] == 'FreeBSD' # FIXME: something is wrong on these
etcdir = case facts[:os]['name']
when 'Debian'
case facts[:os]['release']['major']
when '9'
'/etc/php/7.0/mods-available'
else
'/etc/php5/mods-available'
end
when 'Ubuntu'
case facts[:os]['release']['major']
when '18.04'
'/etc/php/7.2/mods-available'
when '16.04'
'/etc/php/7.0/mods-available'
else
'/etc/php5/mods-available'
end
when 'Archlinux'
'/etc/php/conf.d'
else
'/etc/php.d'
end
context 'installation from repository' do
let(:title) { 'json' }
let(:params) do
{
package_prefix: 'php5-',
settings: {
'test' => 'foo'
}
}
end
it { is_expected.to contain_package('php5-json') }
it do
is_expected.to contain_php__config('json').with(
file: "#{etcdir}/json.ini",
config: {
'extension' => 'json.so',
'test' => 'foo'
}
)
end
end
context 'configure extension without installing a package' do
let(:title) { 'json' }
let(:params) do
{
provider: 'none',
settings: {
'test' => 'foo'
}
}
end
it do
is_expected.to contain_php__config('json').with(
file: "#{etcdir}/json.ini",
require: nil,
config: {
'extension' => 'json.so',
'test' => 'foo'
}
)
end
end
context 'add settings prefix if requested' do
let(:title) { 'json' }
let(:params) do
{
name: 'json',
settings_prefix: true,
settings: {
'test' => 'foo'
}
}
end
it do
is_expected.to contain_php__config('json').with(
config: {
'extension' => 'json.so',
'json.test' => 'foo'
}
)
end
end
context 'use specific settings prefix if requested' do
let(:title) { 'json' }
let(:params) do
{
name: 'json',
settings_prefix: 'bar',
settings: {
'test' => 'foo'
}
}
end
it do
is_expected.to contain_php__config('json').with(
config: {
'extension' => 'json.so',
'bar.test' => 'foo'
}
)
end
end
context 'extensions can be configured as zend' do
let(:title) { 'xdebug' }
let(:params) do
{
zend: true
}
end
it { is_expected.to contain_php__config('xdebug').with_config('zend_extension' => 'xdebug.so') }
end
context 'pecl extensions support so_name' do
let(:title) { 'zendopcache' }
let(:params) do
{
provider: 'pecl',
zend: true,
so_name: 'opcache'
}
end
it do
is_expected.to contain_php__config('zendopcache').with(
file: "#{etcdir}/opcache.ini",
config: {
'zend_extension' => 'opcache.so'
}
)
end
end
context 'add ini file prefix if requested' do
let(:title) { 'zendopcache' }
let(:params) do
{
provider: 'pecl',
zend: true,
ini_prefix: '10-',
so_name: 'opcache'
}
end
it do
is_expected.to contain_php__config('zendopcache').with(
file: "#{etcdir}/10-opcache.ini",
config: {
'zend_extension' => 'opcache.so'
}
)
end
end
context 'pecl extensions support php_api_version' do
let(:title) { 'xdebug' }
let(:params) do
{
provider: 'pecl',
zend: true,
php_api_version: '20100525'
}
end
it { is_expected.to contain_php__config('xdebug').with_config('zend_extension' => '/usr/lib/php5/20100525/xdebug.so') }
end
case facts[:osfamily]
when 'Debian'
context 'on Debian' do
let(:title) { 'xdebug' }
it { is_expected.to contain_php__config('xdebug').with_file("#{etcdir}/xdebug.ini") }
# note to consider: As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default
# http://php.net/manual/en/json.installation.php
context 'pecl installation' do
let(:title) { 'json' }
let(:params) do
{
provider: 'pecl',
header_packages: ['libmemcached-dev'],
name: 'nice_name',
settings: {
'test' => 'foo'
}
}
end
it { is_expected.to contain_package('json') }
it { is_expected.to contain_package('libmemcached-dev') }
it { is_expected.to contain_package('build-essential') }
it do
is_expected.to contain_php__config('json').with(
file: "#{etcdir}/nice_name.ini",
config: {
'extension' => 'nice_name.so',
'test' => 'foo'
}
)
end
end
end
end
end
end
end
end

View File

@@ -1,41 +0,0 @@
require 'spec_helper'
describe 'php::fpm::pool' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts
end
let(:pre_condition) { 'include php' }
case facts[:os]['name']
when 'Debian'
context 'plain config' do
let(:title) { 'unique-name' }
let(:params) { {} }
case facts[:os]['release']['major']
when '9'
it { is_expected.to contain_file('/etc/php/7.0/fpm/pool.d/unique-name.conf') }
else
it { is_expected.to contain_file('/etc/php5/fpm/pool.d/unique-name.conf') }
end
end
when 'Ubuntu'
context 'plain config' do
let(:title) { 'unique-name' }
let(:params) { {} }
case facts[:os]['release']['major']
when '18.04'
it { is_expected.to contain_file('/etc/php/7.2/fpm/pool.d/unique-name.conf') }
when '16.04'
it { is_expected.to contain_file('/etc/php/7.0/fpm/pool.d/unique-name.conf') }
else
it { is_expected.to contain_file('/etc/php5/fpm/pool.d/unique-name.conf') }
end
end
end
end
end
end

View File

@@ -1,22 +0,0 @@
INSTALLED PACKAGES, CHANNEL __URI:
==================================
(no packages installed)
INSTALLED PACKAGES, CHANNEL DOC.PHP.NET:
========================================
(no packages installed)
INSTALLED PACKAGES, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE VERSION STATE
Archive_Tar 1.4.0 stable
Console_Getopt 1.4.1 stable
PEAR 1.10.1 stable
Structures_Graph 1.1.1 stable
XML_Util 1.3.0 stable
INSTALLED PACKAGES, CHANNEL PECL.PHP.NET:
=========================================
PACKAGE VERSION STATE
zip 1.13.5 stable

View File

@@ -1,11 +0,0 @@
PACKAGE DETAILS:
================
Latest 1.2.9
Installed - no -
Package Benchmark
License New BSD
Category Benchmarking
Summary Framework to benchmark PHP scripts or function
calls.
Description Framework to benchmark PHP scripts or function
calls.

View File

@@ -1,10 +0,0 @@
PACKAGE DETAILS:
================
Latest 1.13.5
Installed 1.13.5
Package zip
License PHP 3.01
Category File Formats
Summary A zip management extension
Description Zip is an extension to create, modify and read
zip files.

View File

@@ -1,24 +0,0 @@
require 'spec_helper'
describe 'to_hash_settings' do
input = { 'a' => 1, 'b' => 2 }
results = [
{
'a' => { 'key' => 'a', 'value' => 1 },
'b' => { 'key' => 'b', 'value' => 2 }
},
{
'foo: a' => { 'key' => 'a', 'value' => 1 },
'foo: b' => { 'key' => 'b', 'value' => 2 }
}
]
describe 'when first parameter is not a hash' do
it { is_expected.to run.with_params('baz', input).and_raise_error(Puppet::ParseError) }
end
describe 'when used with proper parameters' do
it { is_expected.to run.with_params(input).and_return(results[0]) }
it { is_expected.to run.with_params(input, 'foo').and_return(results[1]) }
end
end

View File

@@ -1,35 +0,0 @@
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
include RspecPuppetFacts
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
if Dir.exist?(File.expand_path('../../lib', __FILE__))
require 'coveralls'
require 'simplecov'
require 'simplecov-console'
SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::Console
]
SimpleCov.start do
track_files 'lib/**/*.rb'
add_filter '/spec'
add_filter '/vendor'
add_filter '/.vendor'
end
end
RSpec.configure do |c|
default_facts = {
puppetversion: Puppet.version,
facterversion: Facter.version
}
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__))
default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__))
c.default_facts = default_facts
end
# vim: syntax=ruby

View File

@@ -1,19 +0,0 @@
require 'beaker-rspec'
require 'beaker-puppet'
require 'beaker/puppet_install_helper'
require 'beaker/module_install_helper'
run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no'
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ %r{pe}i
install_module_on(hosts)
install_module_dependencies_on(hosts)
RSpec.configure do |c|
# Readable test descriptions
c.formatter = :documentation
hosts.each do |host|
if host[:platform] =~ %r{el-7-x86_64} && host[:hypervisor] =~ %r{docker}
on(host, "sed -i '/nodocs/d' /etc/yum.conf")
end
end
end

View File

@@ -1,140 +0,0 @@
require 'spec_helper'
describe Puppet::Type.type(:package).provider(:pear) do
let(:resource) do
Puppet::Type.type(:package).new name: 'dummy', ensure: :installed
end
let(:provider) do
provider = described_class.new(resource)
provider.resource = resource
provider
end
before do
described_class.stubs(:command).with(:pear).returns '/fake/pear'
resource.provider = provider
end
describe '.instances' do
it 'returns an array of installed packages' do
described_class.expects(:pear).
with('list', '-a').
returns File.read(my_fixture('list_a'))
expect(described_class.instances.map(&:properties)).to eq [
{ name: 'Archive_Tar', vendor: 'pear.php.net', ensure: '1.4.0', provider: :pear },
{ name: 'Console_Getopt', vendor: 'pear.php.net', ensure: '1.4.1', provider: :pear },
{ name: 'PEAR', vendor: 'pear.php.net', ensure: '1.10.1', provider: :pear },
{ name: 'Structures_Graph', vendor: 'pear.php.net', ensure: '1.1.1', provider: :pear },
{ name: 'XML_Util', vendor: 'pear.php.net', ensure: '1.3.0', provider: :pear },
{ name: 'zip', vendor: 'pecl.php.net', ensure: '1.13.5', provider: :pear }
]
end
it 'ignores malformed lines' do
described_class.expects(:pear).
with('list', '-a').
returns 'aaa2.1'
Puppet.expects(:warning).with('Could not match aaa2.1')
expect(described_class.instances).to eq []
end
end
describe '#install' do
it 'installs a package' do
described_class.expects(:pear).
with('-D', 'auto_discover=1', 'upgrade', '--alldeps', 'dummy')
provider.install
end
it 'installs a specific version' do
resource[:ensure] = '0.2'
described_class.expects(:pear).
with('-D', 'auto_discover=1', 'upgrade', '--alldeps', '-f', 'dummy-0.2')
provider.install
end
it 'installs from a specific source' do
resource[:source] = 'pear.php.net/dummy'
described_class.expects(:pear).
with('-D', 'auto_discover=1', 'upgrade', '--alldeps', 'pear.php.net/dummy')
provider.install
end
it 'installs a specific version from a specific source' do
resource[:ensure] = '0.2'
resource[:source] = 'pear.php.net/dummy'
described_class.expects(:pear).
with('-D', 'auto_discover=1', 'upgrade', '--alldeps', '-f', 'pear.php.net/dummy-0.2')
provider.install
end
it 'uses the specified responsefile' do
resource[:responsefile] = '/fake/pearresponse'
Puppet::Util::Execution.expects(:execute).
with(
['/fake/pear', '-D', 'auto_discover=1', 'upgrade', '--alldeps', 'dummy'],
stdinfile: resource[:responsefile]
)
provider.install
end
it 'accepts install_options' do
resource[:install_options] = ['--onlyreqdeps']
described_class.expects(:pear).
with('-D', 'auto_discover=1', 'upgrade', '--onlyreqdeps', 'dummy')
provider.install
end
end
describe '#query' do
it 'queries information about one package' do
described_class.expects(:pear).
with('list', '-a').
returns File.read(my_fixture('list_a'))
resource[:name] = 'pear'
expect(provider.query).to eq(
name: 'PEAR', vendor: 'pear.php.net', ensure: '1.10.1', provider: :pear
)
end
end
describe '#latest' do
it 'fetches the latest version available' do
described_class.expects(:pear).
with('remote-info', 'Benchmark').
returns File.read(my_fixture('remote-info_benchmark'))
resource[:name] = 'Benchmark'
expect(provider.latest).to eq '1.2.9'
end
end
describe '#uninstall' do
it 'uninstalls a package' do
described_class.expects(:pear).
with('uninstall', resource[:name]).
returns('uninstall ok')
provider.uninstall
end
it 'raises an error otherwise' do
described_class.expects(:pear).
with('uninstall', resource[:name]).
returns('unexpected output')
expect { provider.uninstall }.to raise_error(Puppet::Error)
end
end
describe '#update' do
it 'ignores the resource version' do
resource[:ensure] = '2.0'
described_class.expects(:pear).
with('-D', 'auto_discover=1', 'upgrade', '--alldeps', 'dummy')
provider.update
end
end
end

View File

@@ -1,77 +0,0 @@
require 'spec_helper'
describe Puppet::Type.type(:package).provider(:pecl) do
let(:resource) do
Puppet::Type.type(:package).new name: 'dummy', ensure: :installed
end
let(:provider) do
described_class.new(resource)
end
let(:parent_class) do
Puppet::Type::Package::ProviderPear
end
before do
parent_class.stubs(:command).with(:pear).returns '/fake/pear'
end
describe '.instances' do
it 'returns pecl installed packages via pear' do
parent_class.expects(:pear).
with('list', '-a').
returns File.read(fixtures('unit/provider/package/pear/list_a'))
expect(described_class.instances.map(&:properties)).to eq [
{ ensure: '1.13.5', name: 'zip', vendor: 'pecl.php.net', provider: :pecl }
]
end
end
describe '#install' do
it 'installs with pear' do
parent_class.expects(:pear)
provider.install
end
end
describe '#query' do
it 'queries pecl package info via pear' do
parent_class.expects(:pear).
with('list', '-a').
returns File.read(fixtures('unit/provider/package/pear/list_a'))
resource[:name] = 'zip'
expect(provider.query).to eq(ensure: '1.13.5', name: 'zip', vendor: 'pecl.php.net', provider: :pecl)
end
end
describe '#latest' do
it 'fetches the latest version available via pear' do
parent_class.expects(:pear).
with('remote-info', 'pecl.php.net/zip').
returns File.read(fixtures('unit/provider/package/pear/remote-info_zip'))
resource[:name] = 'zip'
expect(provider.latest).to eq '1.13.5'
end
end
describe '#uninstall' do
it 'uninstalls a package via pear' do
parent_class.expects(:pear).
returns('uninstall ok')
provider.uninstall
end
end
describe '#update' do
it 'updates to latest version via pear' do
resource[:ensure] = '2.0'
parent_class.expects(:pear)
provider.update
end
end
end

View File

@@ -1,137 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr otherwise
;include=/etc/php5/fpm/*.conf
;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
[global]
; Pid file
; Note: the default prefix is /var
; Default Value: none
pid = <%= @pid_file %>
; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; in a local file.
; Note: the default prefix is /var
; Default Value: log/php-fpm.log
error_log = <%= @error_log %>
; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
; will be handled differently.
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
; Default Value: daemon
syslog.facility = <%= @syslog_facility %>
; syslog_ident is prepended to every message. If you have multiple FPM
; instances running on the same server, you can change the default value
; which must suit common needs.
; Default Value: php-fpm
syslog.ident = <%= @syslog_ident %>
; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
log_level = <%= @log_level %>
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
; interval set by emergency_restart_interval then FPM will restart. A value
; of '0' means 'Off'.
; Default Value: 0
emergency_restart_threshold = <%= @emergency_restart_threshold %>
; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
emergency_restart_interval = <%= @emergency_restart_interval %>
; Time limit for child processes to wait for a reaction on signals from master.
; Available units: s(econds), m(inutes), h(ours), or d(ays)
; Default Unit: seconds
; Default Value: 0
process_control_timeout = <%= @process_control_timeout %>
; The maximum number of processes FPM will fork. This has been design to control
; the global number of processes when using dynamic PM within a lot of pools.
; Use it with caution.
; Note: A value of 0 indicates no limit
; Default Value: 0
process.max = <%= @process_max %>
; Specify the nice(2) priority to apply to the master process (only if set)
; The value can vary from -19 (highest priority) to 20 (lower priority)
; Note: - It will only work if the FPM master process is launched as root
; - The pool process will inherit the master process priority
; unless it specified otherwise
; Default Value: no set
; process.priority = -19
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
;daemonize = yes
; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
<% if @rlimit_files -%>
rlimit_files = <%= @rlimit_files %>
<% else -%>
;rlimit_files = 1024
<% end -%>
; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0
; Specify the event mechanism FPM will use. The following is available:
; - select (any POSIX os)
; - poll (any POSIX os)
; - epoll (linux >= 2.5.44)
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
; - /dev/poll (Solaris >= 7)
; - port (Solaris >= 10)
; Default Value: not set (auto detection)
;events.mechanism = epoll
; When FPM is build with systemd integration, specify the interval,
; in second, between health report notification to systemd.
; Set to 0 to disable.
; Available Units: s(econds), m(inutes), h(ours)
; Default Unit: seconds
; Default value: 10
<% if @systemd_interval -%>
systemd_interval = <%= @systemd_interval %>
<% else -%>
;systemd_interval = 10
<% end -%>
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;
; Multiple pools of child processes may be started with different listening
; ports and different management options. The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)
; To configure the pools it is recommended to have one .conf file per
; pool in the following directory:
include=<%= @pool_base_dir %>/*.conf

View File

@@ -1,375 +0,0 @@
[<%= @pool %>]
; The address on which to accept FastCGI requests.
listen = <%= @listen %>
; Set listen(2) backlog. A value of '-1' means unlimited.
listen.backlog = <%= @listen_backlog %>
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
; must be separated by a comma. If this value is left blank, connections will be
; accepted from any ip address.
; Default Value: any
<% if @listen_allowed_clients -%>
listen.allowed_clients = <%= @listen_allowed_clients %>
<% else -%>
;listen.allowed_clients = 127.0.0.1
<% end -%>
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server. Many
; BSD-derived systems allow connections regardless of permissions.
; Default Values: user and group are set as the running user
; mode is set to 0666
<% if @listen_owner -%>
listen.owner = <%= @listen_owner %>
<% else -%>
;listen.owner = nobody
<% end -%>
<% if @listen_group -%>
listen.group = <%= @listen_group %>
<% else -%>
;listen.group = nobody
<% end -%>
<% if @listen_mode -%>
listen.mode = <%= @listen_mode %>
<% else -%>
;listen.mode = 0660
<% end -%>
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = <%= @user %>
; RPM: Keep a group allowed to write in log dir.
group = <%= @group_final %>
; Choose how the process manager will control the number of child processes.
; Possible Values:
; static - a fixed number (pm.max_children) of child processes;
; dynamic - the number of child processes are set dynamically based on the
; following directives:
; pm.max_children - the maximum number of children that can
; be alive at the same time.
; pm.start_servers - the number of children created on startup.
; pm.min_spare_servers - the minimum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is less than this
; number then some children will be created.
; pm.max_spare_servers - the maximum number of children in 'idle'
; state (waiting to process). If the number
; of 'idle' processes is greater than this
; number then some children will be killed.
; ondemand - no children are created at startup. Children will be forked when
; new requests will connect. The following parameter are used:
; pm.max_children - the maximum number of children that
; can be alive at the same time.
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
pm = <%= @pm %>
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes to be created when pm is set to 'dynamic'.
; This value sets the limit on the number of simultaneous requests that will be
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
; CGI.
; Note: Used when pm is set to either 'static' or 'dynamic'
; Note: This value is mandatory.
pm.max_children = <%= @pm_max_children %>
; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
pm.start_servers = <%= @pm_start_servers %>
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = <%= @pm_min_spare_servers %>
; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.max_spare_servers = <%= @pm_max_spare_servers %>
; The number of seconds after which an idle process will be killed.
; Note: Used only when pm is set to 'ondemand'
; Default Value: 10s
pm.process_idle_timeout = <%= @pm_process_idle_timeout %>
; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = <%= @pm_max_requests %>
; The URI to view the FPM status page. If this value is not set, no URI will be
; recognized as a status page. By default, the status page shows the following
; information:
; accepted conn - the number of request accepted by the pool;
; pool - the name of the pool;
; process manager - static or dynamic;
; idle processes - the number of idle processes;
; active processes - the number of active processes;
; total processes - the number of idle + active processes.
; The values of 'idle processes', 'active processes' and 'total processes' are
; updated each second. The value of 'accepted conn' is updated in real time.
; Example output:
; accepted conn: 12073
; pool: www
; process manager: static
; idle processes: 35
; active processes: 65
; total processes: 100
; By default the status page output is formatted as text/plain. Passing either
; 'html' or 'json' as a query string will return the corresponding output
; syntax. Example:
; http://www.foo.bar/status
; http://www.foo.bar/status?json
; http://www.foo.bar/status?html
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
<% if @pm_status_path -%>
pm.status_path = <%= @pm_status_path %>
<% else -%>
;pm.status_path = /status
<% end -%>
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
<% if @ping_path -%>
ping.path = <%= @ping_path %>
<% else -%>
;ping.path = /ping
<% end -%>
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
ping.response = <%= @ping_response %>
; The access log file
; Default: not set
<% if @access_log -%>
access.log = <%= @access_log %>
<% end -%>
; The access log format.
; The following syntax is allowed
; %%: the '%' character
; %C: %CPU used by the request
; it can accept the following format:
; - %{user}C for user CPU only
; - %{system}C for system CPU only
; - %{total}C for user + system CPU (default)
; %d: time taken to serve the request
; it can accept the following format:
; - %{seconds}d (default)
; - %{miliseconds}d
; - %{mili}d
; - %{microseconds}d
; - %{micro}d
; %e: an environment variable (same as $_ENV or $_SERVER)
; it must be associated with embraces to specify the name of the env
; variable. Some exemples:
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
; %f: script filename
; %l: content-length of the request (for POST request only)
; %m: request method
; %M: peak of memory allocated by PHP
; it can accept the following format:
; - %{bytes}M (default)
; - %{kilobytes}M
; - %{kilo}M
; - %{megabytes}M
; - %{mega}M
; %n: pool name
; %o: ouput header
; it must be associated with embraces to specify the name of the header:
; - %{Content-Type}o
; - %{X-Powered-By}o
; - %{Transfert-Encoding}o
; - ....
; %p: PID of the child that serviced the request
; %P: PID of the parent of the child that serviced the request
; %q: the query string
; %Q: the '?' character if query string exists
; %r: the request URI (without the query string, see %q and %Q)
; %R: remote IP address
; %s: status (response code)
; %t: server time the request was received
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %T: time the log has been written (the request has finished)
; it can accept a strftime(3) format:
; %d/%b/%Y:%H:%M:%S %z (default)
; %u: remote user
;
; Default: "%R - %u %t \"%m %r\" %s"
access.format = <%= @access_log_format %>
; The timeout for serving a single request after which the worker process will
; be killed. This option should be used when the 'max_execution_time' ini option
; does not stop script execution for some reason. A value of '0' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_terminate_timeout = <%= @request_terminate_timeout %>
; The timeout for serving a single request after which a PHP backtrace will be
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
; Default Value: 0
request_slowlog_timeout = <%= @request_slowlog_timeout %>
; The log file for slow requests
; Default Value: not set
; Note: slowlog is mandatory if request_slowlog_timeout is set
slowlog = <%= @slowlog %>
; Set open file descriptor rlimit.
; Default Value: system defined value
<% if @rlimit_files -%>
rlimit_files = <%= @rlimit_files %>
<% else -%>
;rlimit_files = 1024
<% end -%>
; Set max core size rlimit.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
<% if @rlimit_core -%>
rlimit_core = <%= @rlimit_core %>
<% else -%>
;rlimit_core = 0
<% end -%>
; Chroot to this directory at the start. This value must be defined as an
; absolute path. When this value is not set, chroot is not used.
; Note: chrooting is a great security feature and should be used whenever
; possible. However, all PHP paths will be relative to the chroot
; (error_log, sessions.save_path, ...).
; Default Value: not set
<% if @chroot -%>
chroot = <%= @chroot %>
<% else -%>
;chroot =
<% end -%>
; Chdir to this directory at the start. This value must be an absolute path.
; Default Value: current directory or / when chroot
<% if @chdir -%>
chdir = <%= @chdir %>
<% else -%>
;chdir = /var/www
<% end -%>
; Redirect worker stdout and stderr into main error log. If not set, stdout and
; stderr will be redirected to /dev/null according to FastCGI specs.
; Default Value: no
catch_workers_output = <%= @catch_workers_output %>
; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p arguement)
; - /usr otherwise
<% if @include -%>
include=<%= @include %>
<% else -%>
;include=/etc/php5/fpm/*.conf
<% end -%>
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
; the current environment.
; Default Value: clean env
;env[HOSTNAME] = $HOSTNAME
;env[PATH] = /usr/local/bin:/usr/bin:/bin
;env[TMP] = /tmp
;env[TMPDIR] = /tmp
;env[TEMP] = /tmp
<% @env.each do |var| -%>
env[<%= var %>] = $<%= var %>
<% end -%>
<% @env_value.sort_by {|key,value| key}.each do |key,value| -%>
<% if !value.empty? -%>
env[<%= key %>] = '<%= value %>'
<% end -%>
<% end -%>
; Additional php.ini defines, specific to this pool of workers. These settings
; overwrite the values previously defined in the php.ini. The directives are the
; same as the PHP SAPI:
; php_value/php_flag - you can set classic ini defines which can
; be overwritten from PHP call 'ini_set'.
; php_admin_value/php_admin_flag - these directives won't be overwritten by
; PHP call 'ini_set'
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
; Defining 'extension' will load the corresponding shared extension from
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
; overwrite previously defined php.ini values, but will append the new value
; instead.
; Default Value: nothing is defined by default except the values in php.ini and
; specified at startup with the -d argument
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
;php_flag[display_errors] = off
;php_admin_value[error_log] = /var/log/php-fpm/www-error.log
;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M
;
; Custom PHP values
;
<% @php_value.sort_by {|key,value| key}.each do |key,value| -%>
php_value[<%= key %>] = <%= value %>
<% end -%>
;
; Custom PHP flags
;
<% @php_flag.sort_by {|key,flag| key}.each do |key,flag| -%>
php_flag[<%= key %>] = <%= flag %>
<% end -%>
;
; Custom PHP admin values
;
<% @php_admin_value.sort_by {|key,value| key}.each do |key,value| -%>
php_admin_value[<%= key %>] = <%= value %>
<% end -%>
;
; Custom PHP admin flags
;
<% @php_admin_flag.sort_by {|key,flag| key}.each do |key,flag| -%>
php_admin_flag[<%= key %>] = <%= flag %>
<% end -%>
;
; Custom PHP directives
;
<% @php_directives.each do |line| -%>
<%= line.gsub "{", "%{" %>
<% end -%>
<% if @security_limit_extensions -%>
security.limit_extensions = <%= @security_limit_extensions.join(" ") %>
<% end -%>

View File

@@ -1,8 +0,0 @@
type Php::InstallOptions = Optional[
Array[
Variant[
String,
Hash[String, String]
]
]
]

View File

@@ -1,28 +0,0 @@
type Php::Provider = Enum[
# do nothing
'none',
# php
'pecl',
'pear',
# Debuntu
'dpkg',
'apt',
# RHEL
'yum',
'rpm',
'dnf',
'up2date',
# Suse
'zypper',
'rug',
# FreeBSD
'freebsd',
'pkgng',
'ports',
'portupgrade' # lint:ignore:trailing_comma
]

View File

@@ -1,6 +0,0 @@
type Php::Sapi = Enum[
'ALL',
'cli',
'fpm',
'apache2' # lint:ignore:trailing_comma
]