Skip to content

Commit

Permalink
migrate vars from topscope to relative scope
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed May 5, 2018
1 parent 903d8ad commit 163d7f8
Show file tree
Hide file tree
Showing 18 changed files with 120 additions and 120 deletions.
6 changes: 3 additions & 3 deletions manifests/apache_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
# Hash with nested hash of key => value to set in inifile
#
class php::apache_config(
Stdlib::Absolutepath $inifile = $::php::params::apache_inifile,
Stdlib::Absolutepath $inifile = $php::params::apache_inifile,
Hash $settings = {}
) inherits ::php::params {
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::apache_config is private')
}

$real_settings = deep_merge($settings, hiera_hash('php::apache::settings', {}))

::php::config { 'apache':
php::config { 'apache':
file => $inifile,
config => $real_settings,
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# Hash with nested hash of key => value to set in inifile
#
class php::cli(
Stdlib::Absolutepath $inifile = $::php::params::cli_inifile,
Stdlib::Absolutepath $inifile = $php::params::cli_inifile,
Hash $settings = {}
) inherits ::php::params {
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::cli is private')
Expand Down
12 changes: 6 additions & 6 deletions manifests/composer.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
# UNIX group of the root user
#
class php::composer (
String $source = $::php::params::composer_source,
Stdlib::Absolutepath $path = $::php::params::composer_path,
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 {
Integer $max_age = $php::params::composer_max_age,
Variant[Integer, String] $root_group = $php::params::root_group,
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::composer is private')
Expand All @@ -50,7 +50,7 @@
}

if $auto_update {
class { '::php::composer::auto_update':
class { 'php::composer::auto_update':
max_age => $max_age,
source => $source,
path => $path,
Expand Down
8 changes: 4 additions & 4 deletions manifests/dev.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# 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 {
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::dev is private')
Expand Down Expand Up @@ -43,6 +43,6 @@
}
package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
require => Class['php::packages'],
}
}
12 changes: 6 additions & 6 deletions manifests/embedded.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# 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,
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 {
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::embedded is private')
Expand All @@ -37,9 +37,9 @@

package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
require => Class['php::packages'],
}
-> ::php::config { 'embedded':
-> php::config { 'embedded':
file => $inifile,
config => $real_settings,
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/extension.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
Optional[String] $so_name = downcase($name),
Optional[String] $ini_prefix = undef,
Optional[String] $php_api_version = undef,
String $package_prefix = $::php::package_prefix,
String $package_prefix = $php::package_prefix,
Boolean $zend = false,
Hash $settings = {},
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,
Variant[String, Array[String]] $compiler_packages = $php::params::compiler_packages,
Php::InstallOptions $install_options = undef,
) {

Expand Down
12 changes: 6 additions & 6 deletions manifests/extension/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@
$final_settings = $full_settings
}

$config_root_ini = pick_default($::php::config_root_ini, $::php::params::config_root_ini)
$config_root_ini = pick_default($php::config_root_ini, $php::params::config_root_ini)
::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)
$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}"
Expand All @@ -113,8 +113,8 @@
require => ::Php::Config[$title],
}

if $::php::fpm {
Package[$::php::fpm::package] ~> Exec[$cmd]
if $php::fpm {
Package[$php::fpm::package] ~> Exec[$cmd]
}
}
}
4 changes: 2 additions & 2 deletions manifests/extension/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
String $ensure = 'installed',
Optional[Php::Provider] $provider = undef,
Optional[String] $source = undef,
String $package_prefix = $::php::package_prefix,
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,
Variant[String, Array[String]] $compiler_packages = $php::params::compiler_packages,
Php::InstallOptions $install_options = undef,
) {

Expand Down
36 changes: 18 additions & 18 deletions manifests/fpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@
# 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,
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']) {
Expand All @@ -81,10 +81,10 @@

package { $real_package:
ensure => $ensure,
require => Class['::php::packages'],
require => Class['php::packages'],
}

class { '::php::fpm::config':
class { 'php::fpm::config':
user => $user,
group => $group,
inifile => $inifile,
Expand All @@ -93,8 +93,8 @@
log_group => $log_group,
require => Package[$real_package],
}
contain '::php::fpm::config'
contain '::php::fpm::service'
contain 'php::fpm::config'
contain 'php::fpm::service'

Class['php::fpm::config'] ~> Class['php::fpm::service']

Expand Down
22 changes: 11 additions & 11 deletions manifests/fpm/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,29 @@
# 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,
$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,
Stdlib::Absolutepath $pool_base_dir = $php::params::fpm_pool_dir,
$pool_purge = false,
String $error_log = $::php::params::fpm_error_log,
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,
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,
$root_group = $php::params::root_group,
String $syslog_facility = 'daemon',
String $syslog_ident = 'php-fpm',
) inherits ::php::params {
) inherits php::params {

if $caller_module_name != $module_name {
warning('php::fpm::config is private')
Expand Down
10 changes: 5 additions & 5 deletions manifests/fpm/pool.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
$listen_owner = undef,
$listen_group = undef,
$listen_mode = undef,
$user = $::php::fpm::config::user,
$group = $::php::fpm::config::group,
$user = $php::fpm::config::user,
$group = $php::fpm::config::group,
$pm = 'dynamic',
$pm_max_children = '50',
$pm_start_servers = '5',
Expand Down Expand Up @@ -155,7 +155,7 @@
$php_admin_value = {},
$php_admin_flag = {},
$php_directives = [],
$root_group = $::php::params::root_group,
$root_group = $php::params::root_group,
Optional[Stdlib::Absolutepath] $base_dir = undef,
) {

Expand All @@ -176,10 +176,10 @@
# Implies that the option SET+=FPM was set when building the port.
$real_package = $facts['os']['name'] ? {
'FreeBSD' => [],
default => $::php::fpm::package,
default => $php::fpm::package,
}

$pool_base_dir = pick_default($base_dir, $::php::fpm::config::pool_base_dir, $::php::params::fpm_pool_dir)
$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,
Expand Down
8 changes: 4 additions & 4 deletions manifests/fpm/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# 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,
$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']) {
Expand Down
2 changes: 1 addition & 1 deletion manifests/global.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#
class php::global(
Stdlib::Absolutepath $inifile = $::php::config_root_inifile,
Stdlib::Absolutepath $inifile = $php::config_root_inifile,
Hash $settings = {}
) inherits ::php {

Expand Down
Loading

0 comments on commit 163d7f8

Please sign in to comment.