From 3bd6909196b1a9d28f3a7da882fcecc60a5ba64b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 5 May 2018 22:19:37 +0200 Subject: [PATCH] migrate vars from topscope to relative scope --- manifests/apache_config.pp | 6 ++-- manifests/cli.pp | 4 +-- manifests/composer.pp | 12 +++---- manifests/dev.pp | 8 ++--- manifests/embedded.pp | 12 +++---- manifests/extension.pp | 4 +-- manifests/extension/config.pp | 12 +++---- manifests/extension/install.pp | 4 +-- manifests/fpm.pp | 36 +++++++++---------- manifests/fpm/config.pp | 22 ++++++------ manifests/fpm/pool.pp | 10 +++--- manifests/fpm/service.pp | 8 ++--- manifests/global.pp | 2 +- manifests/init.pp | 66 +++++++++++++++++----------------- manifests/packages.pp | 10 +++--- manifests/pear.pp | 10 +++--- manifests/phpunit.pp | 12 +++---- manifests/repo.pp | 2 +- 18 files changed, 120 insertions(+), 120 deletions(-) diff --git a/manifests/apache_config.pp b/manifests/apache_config.pp index d7730f62..328af26e 100644 --- a/manifests/apache_config.pp +++ b/manifests/apache_config.pp @@ -9,9 +9,9 @@ # 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') @@ -19,7 +19,7 @@ $real_settings = deep_merge($settings, hiera_hash('php::apache::settings', {})) - ::php::config { 'apache': + php::config { 'apache': file => $inifile, config => $real_settings, } diff --git a/manifests/cli.pp b/manifests/cli.pp index 61ca93bb..46d14406 100644 --- a/manifests/cli.pp +++ b/manifests/cli.pp @@ -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') diff --git a/manifests/composer.pp b/manifests/composer.pp index 80712977..76684b0c 100644 --- a/manifests/composer.pp +++ b/manifests/composer.pp @@ -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') @@ -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, diff --git a/manifests/dev.pp b/manifests/dev.pp index 4ebc2b2a..b6841926 100644 --- a/manifests/dev.pp +++ b/manifests/dev.pp @@ -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') @@ -43,6 +43,6 @@ } package { $real_package: ensure => $ensure, - require => Class['::php::packages'], + require => Class['php::packages'], } } diff --git a/manifests/embedded.pp b/manifests/embedded.pp index 5c40ee52..b2de16b9 100644 --- a/manifests/embedded.pp +++ b/manifests/embedded.pp @@ -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') @@ -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, } diff --git a/manifests/extension.pp b/manifests/extension.pp index 313054ac..9ee79325 100644 --- a/manifests/extension.pp +++ b/manifests/extension.pp @@ -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, ) { diff --git a/manifests/extension/config.pp b/manifests/extension/config.pp index 5a2a4517..986b233e 100644 --- a/manifests/extension/config.pp +++ b/manifests/extension/config.pp @@ -89,7 +89,7 @@ $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, @@ -97,9 +97,9 @@ # 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}" @@ -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] } } } diff --git a/manifests/extension/install.pp b/manifests/extension/install.pp index 47795e00..64c7cdcc 100644 --- a/manifests/extension/install.pp +++ b/manifests/extension/install.pp @@ -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, ) { diff --git a/manifests/fpm.pp b/manifests/fpm.pp index 4b22d9b0..76a88fe5 100644 --- a/manifests/fpm.pp +++ b/manifests/fpm.pp @@ -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']) { @@ -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, @@ -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'] diff --git a/manifests/fpm/config.pp b/manifests/fpm/config.pp index 69186907..a64610bb 100644 --- a/manifests/fpm/config.pp +++ b/manifests/fpm/config.pp @@ -71,15 +71,15 @@ # 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, @@ -87,13 +87,13 @@ 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') diff --git a/manifests/fpm/pool.pp b/manifests/fpm/pool.pp index d765e037..7027d389 100644 --- a/manifests/fpm/pool.pp +++ b/manifests/fpm/pool.pp @@ -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', @@ -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, ) { @@ -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, diff --git a/manifests/fpm/service.pp b/manifests/fpm/service.pp index d9748a4d..b4398cc8 100644 --- a/manifests/fpm/service.pp +++ b/manifests/fpm/service.pp @@ -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']) { diff --git a/manifests/global.pp b/manifests/global.pp index dd35f186..eeebb518 100644 --- a/manifests/global.pp +++ b/manifests/global.pp @@ -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 { diff --git a/manifests/init.pp b/manifests/init.pp index c77f04d1..49d93530 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -113,39 +113,39 @@ # [*settings*] # class php ( - String $ensure = $::php::params::ensure, - Boolean $manage_repos = $::php::params::manage_repos, + 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_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_inifile = $php::params::fpm_inifile, $fpm_package = undef, - $fpm_user = $::php::params::fpm_user, - $fpm_group = $::php::params::fpm_group, + $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, + 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 { + $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}") @@ -162,13 +162,13 @@ $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': } + class { 'php::repo': } -> Anchor['php::begin'] } anchor { 'php::begin': } - -> class { '::php::packages': } - -> class { '::php::cli': + -> class { 'php::packages': } + -> class { 'php::cli': settings => $real_settings, } -> anchor { 'php::end': } @@ -176,13 +176,13 @@ # Configure global PHP settings in php.ini if $facts['os']['family'] != 'Debian' { Class['php::packages'] - -> class {'::php::global': + -> class {'php::global': settings => $real_settings, } -> Anchor['php::end'] } - if $fpm { contain '::php::fpm' } + if $fpm { contain 'php::fpm' } if $embedded { if $facts['os']['family'] == 'RedHat' and $fpm { # Both fpm and embeded SAPIs are using same php.ini @@ -190,19 +190,19 @@ } Anchor['php::begin'] - -> class { '::php::embedded': + -> class { 'php::embedded': settings => $real_settings, } -> Anchor['php::end'] } if $dev { Anchor['php::begin'] - -> class { '::php::dev': } + -> class { 'php::dev': } -> Anchor['php::end'] } if $composer { Anchor['php::begin'] - -> class { '::php::composer': + -> class { 'php::composer': proxy_type => $proxy_type, proxy_server => $proxy_server, } @@ -210,36 +210,36 @@ } if $pear { Anchor['php::begin'] - -> class { '::php::pear': + -> class { 'php::pear': ensure => $pear_ensure, } -> Anchor['php::end'] } if $phpunit { Anchor['php::begin'] - -> class { '::php::phpunit': } + -> class { 'php::phpunit': } -> Anchor['php::end'] } if $apache_config { Anchor['php::begin'] - -> class { '::php::apache_config': + -> class { 'php::apache_config': settings => $real_settings, } -> Anchor['php::end'] } - create_resources('::php::extension', $real_extensions, { - require => Class['::php::cli'], + 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 $::osfamily == 'FreeBSD' { + if $facts['os']['family'] == 'FreeBSD' { # Purge the system-wide extensions.ini file { '/usr/local/etc/php/extensions.ini': ensure => absent, - require => Class['::php::packages'], + require => Class['php::packages'], } } } diff --git a/manifests/packages.pp b/manifests/packages.pp index 7c95156d..7680f207 100644 --- a/manifests/packages.pp +++ b/manifests/packages.pp @@ -13,11 +13,11 @@ # 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 { + 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 { if $caller_module_name != $module_name { warning('php::packages is private') diff --git a/manifests/pear.pp b/manifests/pear.pp index f5a6a916..e6118793 100644 --- a/manifests/pear.pp +++ b/manifests/pear.pp @@ -9,10 +9,10 @@ # The package name for PHP pear # class php::pear ( - String $ensure = $::php::pear_ensure, + String $ensure = $php::pear_ensure, Optional[String] $package = undef, Boolean $manage_repos = $php::manage_repos, -) inherits ::php::params { +) inherits php::params { if $caller_module_name != $module_name { warning('php::pear is private') @@ -37,7 +37,7 @@ } 'FreeBSD': { # On FreeBSD the package name is just 'pear'. - $package_name = $::php::params::pear_package_suffix + $package_name = $php::params::pear_package_suffix } default: { # This is the default for all other architectures @@ -61,12 +61,12 @@ package { $package_name: ensure => $ensure, - require => [$require,Class['::php::cli'],Package["${php::package_prefix}xml"]], + require => [$require,Class['php::cli'],Package["${php::package_prefix}xml"]], } } else { package { $package_name: ensure => $ensure, - require => Class['::php::cli'], + require => Class['php::cli'], } } } diff --git a/manifests/phpunit.pp b/manifests/phpunit.pp index 5832be2b..9c44ba2c 100644 --- a/manifests/phpunit.pp +++ b/manifests/phpunit.pp @@ -15,11 +15,11 @@ # 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 $source = $php::params::phpunit_source, + Stdlib::Absolutepath $path = $php::params::phpunit_path, Boolean $auto_update = true, - Integer $max_age = $::php::params::phpunit_max_age, -) inherits ::php::params { + Integer $max_age = $php::params::phpunit_max_age, +) inherits php::params { if $caller_module_name != $module_name { warning('php::phpunit is private') @@ -31,7 +31,7 @@ command => "wget ${source} -O ${path}", creates => $path, path => ['/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/'], - require => [Class['::php::cli'],Package['wget']], + require => [Class['php::cli'],Package['wget']], } -> file { $path: mode => '0555', @@ -40,7 +40,7 @@ } if $auto_update { - class { '::php::phpunit::auto_update': + class { 'php::phpunit::auto_update': max_age => $max_age, source => $source, path => $path, diff --git a/manifests/repo.pp b/manifests/repo.pp index b02e65ae..85b808d4 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -24,7 +24,7 @@ contain ::php::repo::suse } 'RedHat': { - contain '::php::repo::redhat' + contain 'php::repo::redhat' } default: { fail($msg_no_repo)