Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit ba92f1c

Browse files
Merge pull request #154 from coreymbe/LDAP-151
(#151) Install toml gem by default.
2 parents 82d9050 + ac87680 commit ba92f1c

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

manifests/profile/master/install.pp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
# @example Apply this class to the Master and any/all Compilers
66
# include puppet_metrics_dashboard::profile::master::install
77
#
8-
class puppet_metrics_dashboard::profile::master::install {
8+
class puppet_metrics_dashboard::profile::master::install (
9+
Boolean $manage_ldap_auth = true,
10+
) {
11+
912
if $facts['pe_server_version'] {
1013
$puppetserver_service = 'pe-puppetserver'
1114
} else {
1215
$puppetserver_service = 'puppetserver'
1316
}
1417

15-
if $puppet_metrics_dashboard::enable_ldap_auth {
18+
if $manage_ldap_auth {
1619
package { 'toml':
1720
ensure => present,
1821
provider => 'puppetserver_gem',
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
require 'spec_helper'
2+
describe 'puppet_metrics_dashboard::profile::master::install' do
3+
on_supported_os.each do |os, facts|
4+
context "with facter #{RSpec.configuration.default_facter_version} on #{os}" do
5+
let(:node) do
6+
'testhost.example.com'
7+
end
8+
let(:facts) do
9+
facts.merge(pe_server_version: '2019.8.6')
10+
end
11+
12+
context 'with defaults' do
13+
let(:pre_condition) do
14+
<<-PRE_COND
15+
service { 'pe-puppetserver': ensure => running }
16+
PRE_COND
17+
end
18+
let(:params) { { 'manage_ldap_auth' => true } }
19+
20+
it do
21+
is_expected.to contain_package('toml')
22+
.with_ensure('present')
23+
end
24+
it do
25+
is_expected.to contain_package('toml-rb')
26+
.with_ensure('present')
27+
end
28+
end
29+
30+
context 'manage_ldap_auth false' do
31+
let(:pre_condition) do
32+
<<-PRE_COND
33+
service { 'pe-puppetserver': ensure => running }
34+
PRE_COND
35+
end
36+
let(:params) { { 'manage_ldap_auth' => false } }
37+
38+
it do
39+
is_expected.not_to contain_package('toml')
40+
end
41+
it do
42+
is_expected.to contain_package('toml-rb')
43+
.with_ensure('present')
44+
end
45+
end
46+
end
47+
end
48+
end

0 commit comments

Comments
 (0)