From e1618360f5a5834d9d29a13dfbba8f20349692eb Mon Sep 17 00:00:00 2001 From: Luke Bigum Date: Thu, 28 Mar 2019 11:26:20 +0000 Subject: [PATCH] rename LDAP include fragment file extension so it doesn't get included into the default VHost by puppetlabs-apache's include of all *.conf files --- manifests/apache/vhost.pp | 9 +++++---- spec/classes/vhost_spec.rb | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/manifests/apache/vhost.pp b/manifests/apache/vhost.pp index 2c6cdf85..3fde3f02 100644 --- a/manifests/apache/vhost.pp +++ b/manifests/apache/vhost.pp @@ -68,7 +68,7 @@ # No default ($::puppetboard::params::ldap_url) # # [*ldap_bind_authoritative] -# (string) Determines if other authentication providers are used +# (string) Determines if other authentication providers are used # when a user can be mapped to a DN but the server cannot bind with the credentials # No default ($::puppetboard::params::ldap_bind_authoritative) # @@ -125,10 +125,11 @@ } if $enable_ldap_auth { - $ldap_additional_includes = [ "${puppetboard::params::apache_confd}/puppetboard-ldap.conf" ] - $ldap_require = File["${puppetboard::params::apache_confd}/puppetboard-ldap.conf"] - file { "${puppetboard::params::apache_confd}/puppetboard-ldap.conf": + $ldap_additional_includes = [ "${puppetboard::params::apache_confd}/puppetboard-ldap.part" ] + $ldap_require = File["${puppetboard::params::apache_confd}/puppetboard-ldap.part"] + file { 'puppetboard-ldap.part': ensure => present, + path => "${puppetboard::params::apache_confd}/puppetboard-ldap.part", owner => 'root', group => 'root', content => template('puppetboard/apache/ldap.erb'), diff --git a/spec/classes/vhost_spec.rb b/spec/classes/vhost_spec.rb index 05fbca3f..2deff763 100644 --- a/spec/classes/vhost_spec.rb +++ b/spec/classes/vhost_spec.rb @@ -4,8 +4,9 @@ describe 'default params' do let :params do { - 'vhost_name' => 'puppetboard.local', - 'port' => 80 + 'vhost_name' => 'puppetboard.local', + 'port' => 80, + 'enable_ldap_auth' => true } end let(:pre_condition) do @@ -32,9 +33,8 @@ ).that_requires('File[/srv/puppetboard/puppetboard/wsgi.py]') end it do - is_expected.to contain_concat('25-puppetboard.local.conf').with( - 'ensure' => 'present', - 'path' => '/etc/apache2/sites-available/25-puppetboard.local.conf' + is_expected.to contain_file('puppetboard-ldap.part').with( + 'ensure' => 'present' ) end end