diff --git a/manifests/init.pp b/manifests/init.pp index fd152a2..d4a8be0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -96,12 +96,12 @@ class nginx ( $worker_connections = $nginx::params::nx_worker_connections, $worker_processes = $nginx::params::nx_worker_processes, $worker_rlimit_nofile = $nginx::params::nx_worker_rlimit_nofile, - $global_owner = $nginx::params::nx_global_owner, - $global_group = $nginx::params::nx_global_group, - $global_mode = $nginx::params::nx_global_mode, - $sites_available_owner = $nginx::params::nx_sites_available_owner, - $sites_available_group = $nginx::params::nx_sites_available_group, - $sites_available_mode = $nginx::params::nx_sites_available_mode, + $global_owner = $nginx::params::global_owner, + $global_group = $nginx::params::global_group, + $global_mode = $nginx::params::global_mode, + $sites_available_owner = $nginx::params::sites_available_owner, + $sites_available_group = $nginx::params::sites_available_group, + $sites_available_mode = $nginx::params::sites_available_mode, $geo_mappings = {}, $string_mappings = {}, ) inherits nginx::params { diff --git a/manifests/params.pp b/manifests/params.pp index e4df1c6..3acd4b3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -49,13 +49,13 @@ class nginx::params { 'X-Forwarded-For $proxy_add_x_forwarded_for', ] $nx_proxy_cache_path = false - $nx_proxy_cache_levels = 1 + $nx_proxy_cache_levels = '1' $nx_proxy_cache_keys_zone = 'd2:100m' $nx_proxy_cache_max_size = '500m' $nx_proxy_cache_inactive = '20m' $nx_fastcgi_cache_path = false - $nx_fastcgi_cache_levels = 1 + $nx_fastcgi_cache_levels = '1' $nx_fastcgi_cache_keys_zone = 'd3:100m' $nx_fastcgi_cache_max_size = '500m' $nx_fastcgi_cache_inactive = '20m' diff --git a/manifests/resource/upstream.pp b/manifests/resource/upstream.pp index 6938e7a..ba229b3 100644 --- a/manifests/resource/upstream.pp +++ b/manifests/resource/upstream.pp @@ -76,7 +76,7 @@ define nginx::resource::upstream ( # Uses: $name, $upstream_cfg_prepend concat::fragment { "${name}_upstream_header": target => "${nginx::config::conf_dir}/conf.d/${name}-upstream.conf", - order => 10, + order => '10', content => template('nginx/conf.d/upstream_header.erb'), } @@ -84,7 +84,7 @@ define nginx::resource::upstream ( # Uses: $members, $upstream_fail_timeout concat::fragment { "${name}_upstream_members": target => "${nginx::config::conf_dir}/conf.d/${name}-upstream.conf", - order => 50, + order => '50', content => template('nginx/conf.d/upstream_members.erb'), } } else { @@ -94,7 +94,7 @@ define nginx::resource::upstream ( concat::fragment { "${name}_upstream_footer": target => "${nginx::config::conf_dir}/conf.d/${name}-upstream.conf", - order => 90, + order => '90', content => "}\n", } } diff --git a/spec/classes/service_spec.rb b/spec/classes/service_spec.rb index 4db49ad..f717991 100644 --- a/spec/classes/service_spec.rb +++ b/spec/classes/service_spec.rb @@ -26,11 +26,19 @@ describe 'nginx::service' do end describe "when configtest_enable => true" do - let(:params) {{ :configtest_enable => true, :service_restart => '/etc/init.d/nginx configtest && /etc/init.d/nginx restart'}} + let :params do { + :configtest_enable => true, + :service_restart => '/etc/init.d/nginx configtest && /etc/init.d/nginx restart', + :service_ensure => 'running', + } end it { is_expected.to contain_service('nginx').with_restart('/etc/init.d/nginx configtest && /etc/init.d/nginx restart') } context "when service_restart => 'a restart command'" do - let(:params) {{ :configtest_enable => true, :service_restart => 'a restart command' }} + let :params do { + :configtest_enable => true, + :service_restart => 'a restart command', + :service_ensure => 'running', + } end it { is_expected.to contain_service('nginx').with_restart('a restart command') } end end