From 198d326eb00e76fb2f7a6c1f86a270749ceb8edc Mon Sep 17 00:00:00 2001 From: "Carl P. Corliss" Date: Fri, 13 Jun 2014 10:05:30 -0400 Subject: [PATCH] use nx_conf_dir for nginx configuration path --- manifests/resource/geo.pp | 2 +- manifests/resource/map.pp | 2 +- spec/defines/resource_geo_spec.rb | 13 +++++++++++++ spec/defines/resource_map_spec.rb | 13 +++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/manifests/resource/geo.pp b/manifests/resource/geo.pp index ec9efd1..6f91bb6 100644 --- a/manifests/resource/geo.pp +++ b/manifests/resource/geo.pp @@ -79,7 +79,7 @@ define nginx::resource::geo ( mode => '0644', } - file { "/etc/nginx/conf.d/${name}-geo.conf": + file { "${nginx::params::nx_conf_dir}/conf.d/${name}-geo.conf": ensure => $ensure ? { 'absent' => absent, default => 'file', diff --git a/manifests/resource/map.pp b/manifests/resource/map.pp index bc1bb25..a806651 100644 --- a/manifests/resource/map.pp +++ b/manifests/resource/map.pp @@ -63,7 +63,7 @@ define nginx::resource::map ( mode => '0644', } - file { "/etc/nginx/conf.d/${name}-map.conf": + file { "${nginx::params::nx_conf_dir}/conf.d/${name}-map.conf": ensure => $ensure ? { 'absent' => absent, default => 'file', diff --git a/spec/defines/resource_geo_spec.rb b/spec/defines/resource_geo_spec.rb index 7325097..f7aa3ee 100644 --- a/spec/defines/resource_geo_spec.rb +++ b/spec/defines/resource_geo_spec.rb @@ -17,6 +17,19 @@ describe 'nginx::resource::geo' do } end + let :facts do + { + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + } + end + + let :pre_condition do + [ + 'include ::nginx::params', + ] + end + describe 'os-independent items' do describe 'basic assumptions' do let :params do default_params end diff --git a/spec/defines/resource_map_spec.rb b/spec/defines/resource_map_spec.rb index 3cd5e17..4e84381 100644 --- a/spec/defines/resource_map_spec.rb +++ b/spec/defines/resource_map_spec.rb @@ -17,6 +17,19 @@ describe 'nginx::resource::map' do } end + let :facts do + { + :osfamily => 'RedHat', + :operatingsystem => 'CentOS', + } + end + + let :pre_condition do + [ + 'include ::nginx::params', + ] + end + describe 'os-independent items' do describe 'basic assumptions' do let :params do default_params end