From d1b9221a5119e434f45a69683f23b290eed9f5d6 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Tue, 14 Apr 2015 12:33:12 -0400 Subject: [PATCH] location: remove the auth_basic_user_file resource All it's doing right now is copying a file, but the copy of the file is never referenced by the template. --- manifests/resource/location.pp | 9 --------- spec/defines/resource_location_spec.rb | 18 ------------------ 2 files changed, 27 deletions(-) diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index 1ecbd21..892be7e 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -375,13 +375,4 @@ define nginx::resource::location ( order => $ssl_priority, } } - - if ($auth_basic_user_file != undef) { - #Generate htpasswd with provided file-locations - file { "${::nginx::config::conf_dir}/${location_sanitized}_htpasswd": - ensure => $ensure_real, - mode => '0644', - source => $auth_basic_user_file, - } - } } diff --git a/spec/defines/resource_location_spec.rb b/spec/defines/resource_location_spec.rb index aca02e5..54be7c6 100644 --- a/spec/defines/resource_location_spec.rb +++ b/spec/defines/resource_location_spec.rb @@ -665,24 +665,6 @@ describe 'nginx::resource::location' do it { is_expected.not_to contain_concat__fragment(Digest::MD5.hexdigest("vhost1-800-rspec-test-ssl")) } end - context 'when auth_basic_user_file => true' do - let :params do { :auth_basic_user_file => '/path/to/file', :vhost => 'vhost1', :www_root => '/', } end - - it { is_expected.to contain_file("/etc/nginx/rspec-test_htpasswd") } - end - - context 'when ensure => absent' do - let :params do { - :www_root => '/', - :vhost => 'vhost1', - :ensure => 'absent', - :ssl => true, - :auth_basic_user_file => '/path/to/file', - } end - - it { is_expected.to contain_file("/etc/nginx/rspec-test_htpasswd").with_ensure('absent') } - end - context "vhost missing" do let :params do { :www_root => '/',