2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.4.1'
modulesync_config_version: '1.8.0'
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Style/HashSyntax:
Style/RedundantReturn:
Enabled: True

Style/EndOfLine:
Layout/EndOfLine:
Enabled: False

Lint/AmbiguousOperator:
Expand Down
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,25 @@ dist: trusty
language: ruby
cache: bundler
before_install:
- bundle -v
- rm Gemfile.lock || true
- gem update --system
- gem update bundler
- gem --version
- bundle -v
- rm -f Gemfile.lock
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test
- rvm: 2.4.2
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.2
- rvm: 2.5.0
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
Expand Down
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ 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.

## [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)
Expand All @@ -24,6 +52,7 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- release 5.1.0 [\#394](https://github.com/voxpupuli/puppet-php/pull/394) ([bastelfreak](https://github.com/bastelfreak))
- 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))
Expand Down Expand Up @@ -256,4 +285,4 @@ Initial release
[4.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v3.4.2...v4.0.0


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.4.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2.6.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand Down Expand Up @@ -57,7 +57,7 @@ group :system_tests do
end

group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator', :ref => 'master'
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/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
Expand Down
40 changes: 27 additions & 13 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ exclude_paths = %w(
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'
Expand All @@ -48,6 +54,27 @@ task test_with_coveralls: [:test] do
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|
Expand All @@ -62,17 +89,4 @@ begin
end
rescue LoadError
end

desc 'prepare a new release'
task :prepare_release, [:version] do |t, args|
# check for missing parameter
# exit early, exit often
(puts 'you need to provide a version like: rake prepare_releasep[1.0.0]'; exit) unless args[:version]
version = args[:version]
(puts 'format needs to be X.X.X'; exit) unless /^\d+\.\d+\.\d+$/.match(version)
ENV['BLACKSMITH_FULL_VERSION'] = version
Rake::Task['module:bump:full'].invoke
Rake::Task['changelog'].invoke
Rake::Task['strings:generate'].invoke
end
# vim: syntax=ruby
3 changes: 2 additions & 1 deletion manifests/composer/auto_update.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
}

exec { 'update composer':
command => "${path} --no-interaction --quiet self-update",
# 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' ],
Expand Down
31 changes: 18 additions & 13 deletions manifests/dev.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
# 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}",
String $ensure = $::php::ensure,
String $package = "${::php::package_prefix}${::php::params::dev_package_suffix}",
Boolean $manage_repos = $php::manage_repos,
) inherits ::php::params {

if $caller_module_name != $module_name {
Expand All @@ -23,21 +24,25 @@
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 => Class['::apt::update'],
require => $require,
})

package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
}
} else {
package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
}
}
package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
}
}
4 changes: 2 additions & 2 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
}
} else {
case $globals_php_version {
/^7/: {
/^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"
Expand Down Expand Up @@ -104,7 +104,7 @@
}
}
'RedHat': {
$default_config_root = '/etc/php.d'
$default_config_root = '/etc'
$default_fpm_pid_file = '/var/run/php-fpm/php-fpm.pid'
}
'FreeBSD': {
Expand Down
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@
$real_fpm_package = pick($fpm_package, "${package_prefix}${::php::params::fpm_package_suffix}")

# Deep merge global php settings
$real_settings = deep_merge($settings, hiera_hash('php::settings', {}))
$real_settings = deep_merge($settings, lookup('php::settings', {value_type => Hash, merge => 'deep', default_value => {}}))

# Deep merge global php extensions
$real_extensions = deep_merge($extensions, hiera_hash('php::extensions', {}))
$real_extensions = deep_merge($extensions, lookup('php::extensions', {value_type => Hash, merge => 'deep', default_value => {}}))

# Deep merge fpm_pools
$real_fpm_pools = deep_merge($fpm_pools, hiera_hash('php::fpm_pools', {}))
$real_fpm_pools = deep_merge($fpm_pools, lookup('php::fpm_pools', {value_type => Hash, merge => 'deep', default_value => {}}))

# Deep merge fpm_global_pool_settings
$real_fpm_global_pool_settings = deep_merge($fpm_global_pool_settings, hiera_hash('php::fpm_global_pool_settings', {}))
$real_fpm_global_pool_settings = deep_merge($fpm_global_pool_settings, lookup('php::fpm_global_pool_settings', {value_type => Hash, merge => 'deep', default_value => {}}))

if $manage_repos {
class { '::php::repo': }
Expand Down
17 changes: 9 additions & 8 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,25 @@
}
}
'RedHat': {
$config_root_ini = '/etc/php.d'
$config_root_inifile = '/etc/php.ini'
$config_root = $php::globals::globals_config_root
$config_root_ini = "${config_root}/php.d"
$config_root_inifile = "${config_root}/php.ini"
$common_package_names = []
$common_package_suffixes = ['cli', 'common']
$cli_inifile = '/etc/php-cli.ini'
$cli_inifile = "${config_root}/php-cli.ini"
$dev_package_suffix = 'devel'
$fpm_pid_file = $php::globals::globals_fpm_pid_file
$fpm_config_file = '/etc/php-fpm.conf'
$fpm_config_file = "${config_root}/php-fpm.conf"
$fpm_error_log = '/var/log/php-fpm/error.log'
$fpm_inifile = '/etc/php-fpm.ini'
$fpm_inifile = "${config_root}/php-fpm.ini"
$fpm_package_suffix = 'fpm'
$fpm_pool_dir = '/etc/php-fpm.d'
$fpm_pool_dir = "${config_root}/php-fpm.d"
$fpm_service_name = 'php-fpm'
$fpm_user = 'apache'
$fpm_group = 'apache'
$apache_inifile = '/etc/php.ini'
$apache_inifile = "${config_root}/php.ini"
$embedded_package_suffix = 'embedded'
$embedded_inifile = '/etc/php.ini'
$embedded_inifile = "${config_root}/php.ini"
$package_prefix = 'php-'
$compiler_packages = ['gcc', 'gcc-c++', 'make']
$manage_repos = false
Expand Down
50 changes: 29 additions & 21 deletions manifests/pear.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class php::pear (
String $ensure = $::php::pear_ensure,
Optional[String] $package = undef,
Boolean $manage_repos = $php::manage_repos,
) inherits ::php::params {

if $caller_module_name != $module_name {
Expand All @@ -21,39 +22,46 @@
if $package {
$package_name = $package
} 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}"
}
'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}"
}
'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}"
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 => Class['::apt::update'],
require => $require,
})

package { $package_name:
ensure => $ensure,
require => [Class['::apt::update'],Class['::php::cli'],Package["${php::package_prefix}xml"]],
require => [$require,Class['::php::cli'],Package["${php::package_prefix}xml"]],
}
} else {
package { $package_name:
Expand Down
Loading