From 206dc3d263b00ba9394aa6bf437f492431da51f3 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 11 May 2018 00:12:20 +0200 Subject: [PATCH] migrate vars from topscope to relative scope --- manifests/config.pp | 204 +++++++++++++------------- manifests/init.pp | 50 +++---- manifests/package.pp | 16 +- manifests/package/debian.pp | 16 +- manifests/package/redhat.pp | 12 +- manifests/resource/geo.pp | 6 +- manifests/resource/location.pp | 26 ++-- manifests/resource/mailhost.pp | 10 +- manifests/resource/map.pp | 8 +- manifests/resource/server.pp | 40 ++--- manifests/resource/streamhost.pp | 26 ++-- manifests/resource/upstream.pp | 14 +- manifests/resource/upstream/member.pp | 2 +- manifests/service.pp | 10 +- 14 files changed, 220 insertions(+), 220 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index bd53afb44..f5e1345a9 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -17,106 +17,106 @@ assert_private() - $client_body_temp_path = $::nginx::client_body_temp_path - $confd_only = $::nginx::confd_only - $confd_purge = $::nginx::confd_purge - $conf_dir = $::nginx::conf_dir - $daemon = $::nginx::daemon - $daemon_user = $::nginx::daemon_user - $daemon_group = $::nginx::daemon_group - $global_owner = $::nginx::global_owner - $global_group = $::nginx::global_group - $global_mode = $::nginx::global_mode - $log_dir = $::nginx::log_dir - $log_group = $::nginx::log_group - $log_mode = $::nginx::log_mode - $http_access_log = $::nginx::http_access_log - $http_format_log = $::nginx::http_format_log - $nginx_error_log = $::nginx::nginx_error_log - $nginx_error_log_severity = $::nginx::nginx_error_log_severity - $pid = $::nginx::pid - $proxy_temp_path = $::nginx::proxy_temp_path - $root_group = $::nginx::root_group - $run_dir = $::nginx::run_dir - $sites_available_owner = $::nginx::sites_available_owner - $sites_available_group = $::nginx::sites_available_group - $sites_available_mode = $::nginx::sites_available_mode - $super_user = $::nginx::super_user - $temp_dir = $::nginx::temp_dir - $server_purge = $::nginx::server_purge - $accept_mutex = $::nginx::accept_mutex - $accept_mutex_delay = $::nginx::accept_mutex_delay - $client_body_buffer_size = $::nginx::client_body_buffer_size - $client_max_body_size = $::nginx::client_max_body_size - $client_body_timeout = $::nginx::client_body_timeout - $send_timeout = $::nginx::send_timeout - $lingering_timeout = $::nginx::lingering_timeout - $etag = $::nginx::etag - $events_use = $::nginx::events_use - $fastcgi_cache_inactive = $::nginx::fastcgi_cache_inactive - $fastcgi_cache_key = $::nginx::fastcgi_cache_key - $fastcgi_cache_keys_zone = $::nginx::fastcgi_cache_keys_zone - $fastcgi_cache_levels = $::nginx::fastcgi_cache_levels - $fastcgi_cache_max_size = $::nginx::fastcgi_cache_max_size - $fastcgi_cache_path = $::nginx::fastcgi_cache_path - $fastcgi_cache_use_stale = $::nginx::fastcgi_cache_use_stale - $gzip = $::nginx::gzip - $gzip_buffers = $::nginx::gzip_buffers - $gzip_comp_level = $::nginx::gzip_comp_level - $gzip_disable = $::nginx::gzip_disable - $gzip_min_length = $::nginx::gzip_min_length - $gzip_http_version = $::nginx::gzip_http_version - $gzip_proxied = $::nginx::gzip_proxied - $gzip_types = $::nginx::gzip_types - $gzip_vary = $::nginx::gzip_vary - $http_raw_prepend = $::nginx::http_raw_prepend - $http_raw_append = $::nginx::http_raw_append - $http_cfg_prepend = $::nginx::http_cfg_prepend - $http_cfg_append = $::nginx::http_cfg_append - $http_tcp_nodelay = $::nginx::http_tcp_nodelay - $http_tcp_nopush = $::nginx::http_tcp_nopush - $keepalive_timeout = $::nginx::keepalive_timeout - $keepalive_requests = $::nginx::keepalive_requests - $log_format = $::nginx::log_format - $mail = $::nginx::mail - $stream = $::nginx::stream - $multi_accept = $::nginx::multi_accept - $names_hash_bucket_size = $::nginx::names_hash_bucket_size - $names_hash_max_size = $::nginx::names_hash_max_size - $nginx_cfg_prepend = $::nginx::nginx_cfg_prepend - $proxy_buffers = $::nginx::proxy_buffers - $proxy_buffer_size = $::nginx::proxy_buffer_size - $proxy_cache_inactive = $::nginx::proxy_cache_inactive - $proxy_cache_keys_zone = $::nginx::proxy_cache_keys_zone - $proxy_cache_levels = $::nginx::proxy_cache_levels - $proxy_cache_max_size = $::nginx::proxy_cache_max_size - $proxy_cache_path = $::nginx::proxy_cache_path - $proxy_cache_loader_files = $::nginx::proxy_cache_loader_files - $proxy_cache_loader_sleep = $::nginx::proxy_cache_loader_sleep - $proxy_cache_loader_threshold = $::nginx::proxy_cache_loader_threshold - $proxy_use_temp_path = $::nginx::proxy_use_temp_path - $proxy_connect_timeout = $::nginx::proxy_connect_timeout - $proxy_headers_hash_bucket_size = $::nginx::proxy_headers_hash_bucket_size - $proxy_http_version = $::nginx::proxy_http_version - $proxy_read_timeout = $::nginx::proxy_read_timeout - $proxy_redirect = $::nginx::proxy_redirect - $proxy_send_timeout = $::nginx::proxy_send_timeout - $proxy_set_header = $::nginx::proxy_set_header - $proxy_hide_header = $::nginx::proxy_hide_header - $proxy_pass_header = $::nginx::proxy_pass_header - $sendfile = $::nginx::sendfile - $server_tokens = $::nginx::server_tokens - $spdy = $::nginx::spdy - $http2 = $::nginx::http2 - $ssl_stapling = $::nginx::ssl_stapling - $types_hash_bucket_size = $::nginx::types_hash_bucket_size - $types_hash_max_size = $::nginx::types_hash_max_size - $worker_connections = $::nginx::worker_connections - $worker_processes = $::nginx::worker_processes - $worker_rlimit_nofile = $::nginx::worker_rlimit_nofile - $ssl_prefer_server_ciphers = $::nginx::ssl_prefer_server_ciphers - $ssl_protocols = $::nginx::ssl_protocols - $ssl_ciphers = $::nginx::ssl_ciphers + $client_body_temp_path = $nginx::client_body_temp_path + $confd_only = $nginx::confd_only + $confd_purge = $nginx::confd_purge + $conf_dir = $nginx::conf_dir + $daemon = $nginx::daemon + $daemon_user = $nginx::daemon_user + $daemon_group = $nginx::daemon_group + $global_owner = $nginx::global_owner + $global_group = $nginx::global_group + $global_mode = $nginx::global_mode + $log_dir = $nginx::log_dir + $log_group = $nginx::log_group + $log_mode = $nginx::log_mode + $http_access_log = $nginx::http_access_log + $http_format_log = $nginx::http_format_log + $nginx_error_log = $nginx::nginx_error_log + $nginx_error_log_severity = $nginx::nginx_error_log_severity + $pid = $nginx::pid + $proxy_temp_path = $nginx::proxy_temp_path + $root_group = $nginx::root_group + $run_dir = $nginx::run_dir + $sites_available_owner = $nginx::sites_available_owner + $sites_available_group = $nginx::sites_available_group + $sites_available_mode = $nginx::sites_available_mode + $super_user = $nginx::super_user + $temp_dir = $nginx::temp_dir + $server_purge = $nginx::server_purge + $accept_mutex = $nginx::accept_mutex + $accept_mutex_delay = $nginx::accept_mutex_delay + $client_body_buffer_size = $nginx::client_body_buffer_size + $client_max_body_size = $nginx::client_max_body_size + $client_body_timeout = $nginx::client_body_timeout + $send_timeout = $nginx::send_timeout + $lingering_timeout = $nginx::lingering_timeout + $etag = $nginx::etag + $events_use = $nginx::events_use + $fastcgi_cache_inactive = $nginx::fastcgi_cache_inactive + $fastcgi_cache_key = $nginx::fastcgi_cache_key + $fastcgi_cache_keys_zone = $nginx::fastcgi_cache_keys_zone + $fastcgi_cache_levels = $nginx::fastcgi_cache_levels + $fastcgi_cache_max_size = $nginx::fastcgi_cache_max_size + $fastcgi_cache_path = $nginx::fastcgi_cache_path + $fastcgi_cache_use_stale = $nginx::fastcgi_cache_use_stale + $gzip = $nginx::gzip + $gzip_buffers = $nginx::gzip_buffers + $gzip_comp_level = $nginx::gzip_comp_level + $gzip_disable = $nginx::gzip_disable + $gzip_min_length = $nginx::gzip_min_length + $gzip_http_version = $nginx::gzip_http_version + $gzip_proxied = $nginx::gzip_proxied + $gzip_types = $nginx::gzip_types + $gzip_vary = $nginx::gzip_vary + $http_raw_prepend = $nginx::http_raw_prepend + $http_raw_append = $nginx::http_raw_append + $http_cfg_prepend = $nginx::http_cfg_prepend + $http_cfg_append = $nginx::http_cfg_append + $http_tcp_nodelay = $nginx::http_tcp_nodelay + $http_tcp_nopush = $nginx::http_tcp_nopush + $keepalive_timeout = $nginx::keepalive_timeout + $keepalive_requests = $nginx::keepalive_requests + $log_format = $nginx::log_format + $mail = $nginx::mail + $stream = $nginx::stream + $multi_accept = $nginx::multi_accept + $names_hash_bucket_size = $nginx::names_hash_bucket_size + $names_hash_max_size = $nginx::names_hash_max_size + $nginx_cfg_prepend = $nginx::nginx_cfg_prepend + $proxy_buffers = $nginx::proxy_buffers + $proxy_buffer_size = $nginx::proxy_buffer_size + $proxy_cache_inactive = $nginx::proxy_cache_inactive + $proxy_cache_keys_zone = $nginx::proxy_cache_keys_zone + $proxy_cache_levels = $nginx::proxy_cache_levels + $proxy_cache_max_size = $nginx::proxy_cache_max_size + $proxy_cache_path = $nginx::proxy_cache_path + $proxy_cache_loader_files = $nginx::proxy_cache_loader_files + $proxy_cache_loader_sleep = $nginx::proxy_cache_loader_sleep + $proxy_cache_loader_threshold = $nginx::proxy_cache_loader_threshold + $proxy_use_temp_path = $nginx::proxy_use_temp_path + $proxy_connect_timeout = $nginx::proxy_connect_timeout + $proxy_headers_hash_bucket_size = $nginx::proxy_headers_hash_bucket_size + $proxy_http_version = $nginx::proxy_http_version + $proxy_read_timeout = $nginx::proxy_read_timeout + $proxy_redirect = $nginx::proxy_redirect + $proxy_send_timeout = $nginx::proxy_send_timeout + $proxy_set_header = $nginx::proxy_set_header + $proxy_hide_header = $nginx::proxy_hide_header + $proxy_pass_header = $nginx::proxy_pass_header + $sendfile = $nginx::sendfile + $server_tokens = $nginx::server_tokens + $spdy = $nginx::spdy + $http2 = $nginx::http2 + $ssl_stapling = $nginx::ssl_stapling + $types_hash_bucket_size = $nginx::types_hash_bucket_size + $types_hash_max_size = $nginx::types_hash_max_size + $worker_connections = $nginx::worker_connections + $worker_processes = $nginx::worker_processes + $worker_rlimit_nofile = $nginx::worker_rlimit_nofile + $ssl_prefer_server_ciphers = $nginx::ssl_prefer_server_ciphers + $ssl_protocols = $nginx::ssl_protocols + $ssl_ciphers = $nginx::ssl_ciphers # Non-configurable settings $conf_template = 'nginx/conf.d/nginx.conf.erb' @@ -147,12 +147,12 @@ File["${conf_dir}/conf.d"] { purge => true, recurse => true, - notify => Class['::nginx::service'], + notify => Class['nginx::service'], } File["${conf_dir}/conf.stream.d"] { purge => true, recurse => true, - notify => Class['::nginx::service'], + notify => Class['nginx::service'], } } } diff --git a/manifests/init.pp b/manifests/init.pp index 37084933d..45c4f9783 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -26,32 +26,32 @@ # } class nginx ( ### START Nginx Configuration ### - $client_body_temp_path = $::nginx::params::client_body_temp_path, + $client_body_temp_path = $nginx::params::client_body_temp_path, Boolean $confd_only = false, Boolean $confd_purge = false, - $conf_dir = $::nginx::params::conf_dir, + $conf_dir = $nginx::params::conf_dir, Optional[Enum['on', 'off']] $daemon = undef, - $daemon_user = $::nginx::params::daemon_user, + $daemon_user = $nginx::params::daemon_user, $daemon_group = undef, - $global_owner = $::nginx::params::global_owner, - $global_group = $::nginx::params::global_group, - $global_mode = $::nginx::params::global_mode, - $log_dir = $::nginx::params::log_dir, - $log_group = $::nginx::params::log_group, + $global_owner = $nginx::params::global_owner, + $global_group = $nginx::params::global_group, + $global_mode = $nginx::params::global_mode, + $log_dir = $nginx::params::log_dir, + $log_group = $nginx::params::log_group, $log_mode = '0750', Variant[String, Array[String]] $http_access_log = "${log_dir}/${::nginx::params::http_access_log_file}", $http_format_log = undef, Variant[String, Array[String]] $nginx_error_log = "${log_dir}/${::nginx::params::nginx_error_log_file}", Nginx::ErrorLogSeverity $nginx_error_log_severity = 'error', - $pid = $::nginx::params::pid, - $proxy_temp_path = $::nginx::params::proxy_temp_path, - $root_group = $::nginx::params::root_group, - $run_dir = $::nginx::params::run_dir, - $sites_available_owner = $::nginx::params::sites_available_owner, - $sites_available_group = $::nginx::params::sites_available_group, - $sites_available_mode = $::nginx::params::sites_available_mode, - Boolean $super_user = $::nginx::params::super_user, - $temp_dir = $::nginx::params::temp_dir, + $pid = $nginx::params::pid, + $proxy_temp_path = $nginx::params::proxy_temp_path, + $root_group = $nginx::params::root_group, + $run_dir = $nginx::params::run_dir, + $sites_available_owner = $nginx::params::sites_available_owner, + $sites_available_group = $nginx::params::sites_available_group, + $sites_available_mode = $nginx::params::sites_available_mode, + Boolean $super_user = $nginx::params::super_user, + $temp_dir = $nginx::params::temp_dir, Boolean $server_purge = false, # Primary Templates @@ -141,10 +141,10 @@ ### START Package Configuration ### $package_ensure = present, - $package_name = $::nginx::params::package_name, + $package_name = $nginx::params::package_name, $package_source = 'nginx', $package_flavor = undef, - $manage_repo = $::nginx::params::manage_repo, + $manage_repo = $nginx::params::manage_repo, Optional[String] $repo_release = undef, $passenger_package_ensure = 'present', ### END Package Configuration ### @@ -169,11 +169,11 @@ $nginx_servers = {}, $nginx_servers_defaults = {}, ### END Hiera Lookups ### -) inherits ::nginx::params { +) inherits nginx::params { - contain '::nginx::package' - contain '::nginx::config' - contain '::nginx::service' + contain 'nginx::package' + contain 'nginx::config' + contain 'nginx::service' create_resources('nginx::resource::upstream', $nginx_upstreams) create_resources('nginx::resource::server', $nginx_servers, $nginx_servers_defaults) @@ -186,6 +186,6 @@ # Allow the end user to establish relationships to the "main" class # and preserve the relationship to the implementation classes through # a transitive relationship to the composite class. - Class['::nginx::package'] -> Class['::nginx::config'] ~> Class['::nginx::service'] - Class['::nginx::package'] ~> Class['::nginx::service'] + Class['nginx::package'] -> Class['nginx::config'] ~> Class['nginx::service'] + Class['nginx::package'] ~> Class['nginx::service'] } diff --git a/manifests/package.pp b/manifests/package.pp index b39021d6e..6ccc09d89 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -15,21 +15,21 @@ # This class file is not called directly class nginx::package { - $package_name = $::nginx::package_name - $package_source = $::nginx::package_source - $package_ensure = $::nginx::package_ensure - $package_flavor = $::nginx::package_flavor - $passenger_package_ensure = $::nginx::passenger_package_ensure - $manage_repo = $::nginx::manage_repo + $package_name = $nginx::package_name + $package_source = $nginx::package_source + $package_ensure = $nginx::package_ensure + $package_flavor = $nginx::package_flavor + $passenger_package_ensure = $nginx::passenger_package_ensure + $manage_repo = $nginx::manage_repo assert_private() case $facts['os']['family'] { 'redhat': { - contain ::nginx::package::redhat + contain nginx::package::redhat } 'debian': { - contain ::nginx::package::debian + contain nginx::package::debian } 'Solaris': { # $package_name needs to be specified. SFEnginx,CSWnginx depending on diff --git a/manifests/package/debian.pp b/manifests/package/debian.pp index fdd2dda36..83036530c 100644 --- a/manifests/package/debian.pp +++ b/manifests/package/debian.pp @@ -15,13 +15,13 @@ # This class file is not called directly class nginx::package::debian { - $package_name = $::nginx::package_name - $package_source = $::nginx::package_source - $package_ensure = $::nginx::package_ensure - $package_flavor = $::nginx::package_flavor - $passenger_package_ensure = $::nginx::passenger_package_ensure - $manage_repo = $::nginx::manage_repo - $release = $::nginx::repo_release + $package_name = $nginx::package_name + $package_source = $nginx::package_source + $package_ensure = $nginx::package_ensure + $package_flavor = $nginx::package_flavor + $passenger_package_ensure = $nginx::passenger_package_ensure + $manage_repo = $nginx::manage_repo + $release = $nginx::repo_release $distro = downcase($facts['os']['name']) @@ -31,7 +31,7 @@ } if $manage_repo { - include '::apt' + include 'apt' Exec['apt_update'] -> Package['nginx'] case $package_source { diff --git a/manifests/package/redhat.pp b/manifests/package/redhat.pp index 66c38ca74..b19e95e86 100644 --- a/manifests/package/redhat.pp +++ b/manifests/package/redhat.pp @@ -15,12 +15,12 @@ # This class file is not called directly class nginx::package::redhat { - $package_name = $::nginx::package_name - $package_source = $::nginx::package_source - $package_ensure = $::nginx::package_ensure - $package_flavor = $::nginx::package_flavor - $passenger_package_ensure = $::nginx::passenger_package_ensure - $manage_repo = $::nginx::manage_repo + $package_name = $nginx::package_name + $package_source = $nginx::package_source + $package_ensure = $nginx::package_ensure + $package_flavor = $nginx::package_flavor + $passenger_package_ensure = $nginx::passenger_package_ensure + $manage_repo = $nginx::manage_repo #Install the CentOS-specific packages on that OS, otherwise assume it's a RHEL #clone and provide the Red Hat-specific package. This comes into play when not diff --git a/manifests/resource/geo.pp b/manifests/resource/geo.pp index 0c85324ef..e8d120c75 100644 --- a/manifests/resource/geo.pp +++ b/manifests/resource/geo.pp @@ -67,8 +67,8 @@ fail('You must include the nginx base class before using any defined resources') } - $root_group = $::nginx::root_group - $conf_dir = "${::nginx::conf_dir}/conf.d" + $root_group = $nginx::root_group + $conf_dir = "${nginx::conf_dir}/conf.d" $ensure_real = $ensure ? { 'absent' => 'absent', @@ -84,7 +84,7 @@ file { "${conf_dir}/${name}-geo.conf": ensure => $ensure_real, content => template('nginx/conf.d/geo.erb'), - notify => Class['::nginx::service'], + notify => Class['nginx::service'], require => File[$conf_dir], } } diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index 397cd50bf..7ceed6685 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -171,14 +171,14 @@ 'index.htm', 'index.php'], Optional[String] $proxy = undef, - Optional[String] $proxy_redirect = $::nginx::proxy_redirect, - String $proxy_read_timeout = $::nginx::proxy_read_timeout, - String $proxy_connect_timeout = $::nginx::proxy_connect_timeout, - String $proxy_send_timeout = $::nginx::proxy_send_timeout, - Array $proxy_set_header = $::nginx::proxy_set_header, - Array $proxy_hide_header = $::nginx::proxy_hide_header, - Array $proxy_pass_header = $::nginx::proxy_pass_header, - Array $proxy_ignore_header = $::nginx::proxy_ignore_header, + Optional[String] $proxy_redirect = $nginx::proxy_redirect, + String $proxy_read_timeout = $nginx::proxy_read_timeout, + String $proxy_connect_timeout = $nginx::proxy_connect_timeout, + String $proxy_send_timeout = $nginx::proxy_send_timeout, + Array $proxy_set_header = $nginx::proxy_set_header, + Array $proxy_hide_header = $nginx::proxy_hide_header, + Array $proxy_pass_header = $nginx::proxy_pass_header, + Array $proxy_ignore_header = $nginx::proxy_ignore_header, Optional[String] $proxy_next_upstream = undef, Optional[String] $fastcgi = undef, Optional[String] $fastcgi_index = undef, @@ -231,7 +231,7 @@ fail('You must include the nginx base class before using any defined resources') } - $root_group = $::nginx::root_group + $root_group = $nginx::root_group File { owner => 'root', @@ -257,10 +257,10 @@ } $server_sanitized = regsubst($server, ' ', '_', 'G') - if $::nginx::confd_only { - $server_dir = "${::nginx::conf_dir}/conf.d" + if $nginx::confd_only { + $server_dir = "${nginx::conf_dir}/conf.d" } else { - $server_dir = "${::nginx::conf_dir}/sites-available" + $server_dir = "${nginx::conf_dir}/sites-available" } $config_file = "${server_dir}/${server_sanitized}.conf" @@ -272,7 +272,7 @@ $ensure == present and $fastcgi != undef and !defined(File[$fastcgi_params]) and - $fastcgi_params == "${::nginx::conf_dir}/fastcgi.conf" + $fastcgi_params == "${nginx::conf_dir}/fastcgi.conf" ) { file { $fastcgi_params: ensure => present, diff --git a/manifests/resource/mailhost.pp b/manifests/resource/mailhost.pp index fb3f5486f..ffaca8c9e 100644 --- a/manifests/resource/mailhost.pp +++ b/manifests/resource/mailhost.pp @@ -87,16 +87,16 @@ String $ipv6_listen_options = 'default ipv6only=on', Boolean $ssl = false, Optional[String] $ssl_cert = undef, - String $ssl_ciphers = $::nginx::ssl_ciphers, + String $ssl_ciphers = $nginx::ssl_ciphers, Optional[String] $ssl_client_cert = undef, Optional[String] $ssl_crl = undef, - Optional[String] $ssl_dhparam = $::nginx::ssl_dhparam, + Optional[String] $ssl_dhparam = $nginx::ssl_dhparam, Optional[String] $ssl_ecdh_curve = undef, Optional[String] $ssl_key = undef, Optional[String] $ssl_password_file = undef, Optional[Integer] $ssl_port = undef, - Enum['on', 'off'] $ssl_prefer_server_ciphers = $::nginx::ssl_prefer_server_ciphers, - String $ssl_protocols = $::nginx::ssl_protocols, + Enum['on', 'off'] $ssl_prefer_server_ciphers = $nginx::ssl_prefer_server_ciphers, + String $ssl_protocols = $nginx::ssl_protocols, Optional[String] $ssl_session_cache = undef, Optional[String] $ssl_session_ticket_key = undef, Optional[String] $ssl_session_tickets = undef, @@ -127,7 +127,7 @@ fail('You must include the nginx base class before using any defined resources') } - $root_group = $::nginx::root_group + $root_group = $nginx::root_group File { owner => 'root', diff --git a/manifests/resource/map.pp b/manifests/resource/map.pp index 152c414fb..592bdd02d 100644 --- a/manifests/resource/map.pp +++ b/manifests/resource/map.pp @@ -83,8 +83,8 @@ fail('You must include the nginx base class before using any defined resources') } - $root_group = $::nginx::root_group - $conf_dir = "${::nginx::conf_dir}/conf.d" + $root_group = $nginx::root_group + $conf_dir = "${nginx::conf_dir}/conf.d" $ensure_real = $ensure ? { 'absent' => absent, @@ -97,10 +97,10 @@ mode => '0644', } - file { "${::nginx::conf_dir}/conf.d/${name}-map.conf": + file { "${nginx::conf_dir}/conf.d/${name}-map.conf": ensure => $ensure_real, content => template('nginx/conf.d/map.erb'), - notify => Class['::nginx::service'], + notify => Class['nginx::service'], require => File[$conf_dir], } } diff --git a/manifests/resource/server.pp b/manifests/resource/server.pp index 254b1d286..d6853c684 100644 --- a/manifests/resource/server.pp +++ b/manifests/resource/server.pp @@ -160,16 +160,16 @@ Optional[Variant[String, Boolean]] $ssl_cert = undef, Optional[String] $ssl_client_cert = undef, String $ssl_verify_client = 'on', - Optional[String] $ssl_dhparam = $::nginx::ssl_dhparam, + Optional[String] $ssl_dhparam = $nginx::ssl_dhparam, Optional[String] $ssl_ecdh_curve = undef, Boolean $ssl_redirect = false, Optional[Integer] $ssl_redirect_port = undef, Optional[Variant[String, Boolean]] $ssl_key = undef, Integer $ssl_port = 443, - Enum['on', 'off'] $ssl_prefer_server_ciphers = $::nginx::ssl_prefer_server_ciphers, - String $ssl_protocols = $::nginx::ssl_protocols, + Enum['on', 'off'] $ssl_prefer_server_ciphers = $nginx::ssl_prefer_server_ciphers, + String $ssl_protocols = $nginx::ssl_protocols, $ssl_buffer_size = undef, - String $ssl_ciphers = $::nginx::ssl_ciphers, + String $ssl_ciphers = $nginx::ssl_ciphers, String $ssl_cache = 'shared:SSL:10m', Optional[String] $ssl_crl = undef, Boolean $ssl_stapling = false, @@ -181,16 +181,16 @@ Optional[String] $ssl_session_ticket_key = undef, Optional[String] $ssl_trusted_cert = undef, Optional[Integer] $ssl_verify_depth = undef, - String $spdy = $::nginx::spdy, - $http2 = $::nginx::http2, + String $spdy = $nginx::spdy, + $http2 = $nginx::http2, Optional[String] $proxy = undef, Optional[String]$proxy_redirect = undef, - String $proxy_read_timeout = $::nginx::proxy_read_timeout, - String $proxy_send_timeout = $::nginx::proxy_send_timeout, - $proxy_connect_timeout = $::nginx::proxy_connect_timeout, - Array[String] $proxy_set_header = $::nginx::proxy_set_header, - Array[String] $proxy_hide_header = $::nginx::proxy_hide_header, - Array[String] $proxy_pass_header = $::nginx::proxy_pass_header, + String $proxy_read_timeout = $nginx::proxy_read_timeout, + String $proxy_send_timeout = $nginx::proxy_send_timeout, + $proxy_connect_timeout = $nginx::proxy_connect_timeout, + Array[String] $proxy_set_header = $nginx::proxy_set_header, + Array[String] $proxy_hide_header = $nginx::proxy_hide_header, + Array[String] $proxy_pass_header = $nginx::proxy_pass_header, Optional[String] $proxy_cache = undef, Optional[String] $proxy_cache_key = undef, Optional[String] $proxy_cache_use_stale = undef, @@ -253,9 +253,9 @@ $string_mappings = {}, $geo_mappings = {}, Optional[String] $gzip_types = undef, - String $owner = $::nginx::global_owner, - String $group = $::nginx::global_group, - String $mode = $::nginx::global_mode, + String $owner = $nginx::global_owner, + String $group = $nginx::global_group, + String $mode = $nginx::global_mode, Boolean $maintenance = false, String $maintenance_value = 'return 503', $error_pages = undef, @@ -268,11 +268,11 @@ } # Variables - if $::nginx::confd_only { - $server_dir = "${::nginx::conf_dir}/conf.d" + if $nginx::confd_only { + $server_dir = "${nginx::conf_dir}/conf.d" } else { - $server_dir = "${::nginx::conf_dir}/sites-available" - $server_enable_dir = "${::nginx::conf_dir}/sites-enabled" + $server_dir = "${nginx::conf_dir}/sites-available" + $server_enable_dir = "${nginx::conf_dir}/sites-enabled" $server_symlink_ensure = $ensure ? { 'absent' => absent, default => 'link', @@ -446,7 +446,7 @@ } } - unless $::nginx::confd_only { + unless $nginx::confd_only { file{ "${name_sanitized}.conf symlink": ensure => $server_symlink_ensure, path => "${server_enable_dir}/${name_sanitized}.conf", diff --git a/manifests/resource/streamhost.pp b/manifests/resource/streamhost.pp index 01cdd298e..5d43c8f76 100644 --- a/manifests/resource/streamhost.pp +++ b/manifests/resource/streamhost.pp @@ -56,14 +56,14 @@ Integer $ipv6_listen_port = 80, String $ipv6_listen_options = 'default ipv6only=on', $proxy = undef, - String $proxy_read_timeout = $::nginx::proxy_read_timeout, - $proxy_connect_timeout = $::nginx::proxy_connect_timeout, + String $proxy_read_timeout = $nginx::proxy_read_timeout, + $proxy_connect_timeout = $nginx::proxy_connect_timeout, Array $resolver = [], $raw_prepend = undef, $raw_append = undef, - String $owner = $::nginx::global_owner, - String $group = $::nginx::global_group, - String $mode = $::nginx::global_mode, + String $owner = $nginx::global_owner, + String $group = $nginx::global_group, + String $mode = $nginx::global_mode, ) { if ! defined(Class['nginx']) { @@ -71,11 +71,11 @@ } # Variables - if $::nginx::confd_only { - $streamhost_dir = "${::nginx::conf_dir}/conf.stream.d" + if $nginx::confd_only { + $streamhost_dir = "${nginx::conf_dir}/conf.stream.d" } else { - $streamhost_dir = "${::nginx::conf_dir}/streams-available" - $streamhost_enable_dir = "${::nginx::conf_dir}/streams-enabled" + $streamhost_dir = "${nginx::conf_dir}/streams-available" + $streamhost_enable_dir = "${nginx::conf_dir}/streams-enabled" $streamhost_symlink_ensure = $ensure ? { 'absent' => absent, default => 'link', @@ -90,7 +90,7 @@ 'absent' => absent, default => 'file', }, - notify => Class['::nginx::service'], + notify => Class['nginx::service'], owner => $owner, group => $group, mode => $mode, @@ -106,7 +106,7 @@ owner => $owner, group => $group, mode => $mode, - notify => Class['::nginx::service'], + notify => Class['nginx::service'], require => File[$streamhost_dir], } @@ -116,13 +116,13 @@ order => '001', } - unless $::nginx::confd_only { + unless $nginx::confd_only { file{ "${name_sanitized}.conf symlink": ensure => $streamhost_symlink_ensure, path => "${streamhost_enable_dir}/${name_sanitized}.conf", target => $config_file, require => [Concat[$config_file], File[$streamhost_enable_dir]], - notify => Class['::nginx::service'], + notify => Class['nginx::service'], } } } diff --git a/manifests/resource/upstream.pp b/manifests/resource/upstream.pp index 926303920..91dac6ccd 100644 --- a/manifests/resource/upstream.pp +++ b/manifests/resource/upstream.pp @@ -67,7 +67,7 @@ default => 'conf.d', } - $conf_dir = "${::nginx::config::conf_dir}/${conf_dir_real}" + $conf_dir = "${nginx::config::conf_dir}/${conf_dir_real}" Concat { owner => 'root', @@ -75,7 +75,7 @@ mode => '0644', } - concat { "${::nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf": + concat { "${nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf": ensure => $ensure_real, notify => Class['::nginx::service'], require => File[$conf_dir], @@ -83,7 +83,7 @@ # Uses: $name, $upstream_cfg_prepend concat::fragment { "${name}_upstream_header": - target => "${::nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf", + target => "${nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf", order => '10', content => template('nginx/upstream/upstream_header.erb'), } @@ -91,21 +91,21 @@ if $members != undef { # Uses: $members, $upstream_fail_timeout concat::fragment { "${name}_upstream_members": - target => "${::nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf", + target => "${nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf", order => '50', content => template('nginx/upstream/upstream_members.erb'), } } else { # Collect exported members: if $members_tag { - ::Nginx::Resource::Upstream::Member <<| upstream == $name and tag == $members_tag |>> + Nginx::Resource::Upstream::Member <<| upstream == $name and tag == $members_tag |>> } else { - ::Nginx::Resource::Upstream::Member <<| upstream == $name |>> + Nginx::Resource::Upstream::Member <<| upstream == $name |>> } } concat::fragment { "${name}_upstream_footer": - target => "${::nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf", + target => "${nginx::conf_dir}/${conf_dir_real}/${name}-upstream.conf", order => '90', content => template('nginx/upstream/upstream_footer.erb'), } diff --git a/manifests/resource/upstream/member.pp b/manifests/resource/upstream/member.pp index de597db36..7ce6ea5a9 100644 --- a/manifests/resource/upstream/member.pp +++ b/manifests/resource/upstream/member.pp @@ -47,7 +47,7 @@ # Uses: $server, $port, $upstream_fail_timeout concat::fragment { "${upstream}_upstream_member_${name}": - target => "${::nginx::conf_dir}/conf.d/${upstream}-upstream.conf", + target => "${nginx::conf_dir}/conf.d/${upstream}-upstream.conf", order => 40, content => template('nginx/upstream/upstream_member.erb'), } diff --git a/manifests/service.pp b/manifests/service.pp index d0ec3f36d..0572fc114 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -14,11 +14,11 @@ # # This class file is not called directly class nginx::service( - $service_restart = $::nginx::service_restart, - $service_ensure = $::nginx::service_ensure, - $service_name = $::nginx::service_name, - $service_flags = $::nginx::service_flags, - $service_manage = $::nginx::service_manage, + $service_restart = $nginx::service_restart, + $service_ensure = $nginx::service_ensure, + $service_name = $nginx::service_name, + $service_flags = $nginx::service_flags, + $service_manage = $nginx::service_manage, ) { assert_private()