This repository was archived by the owner on Jun 1, 2023. It is now read-only.
File tree 2 files changed +53
-2
lines changed
spec/classes/profile/master 2 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 5
5
# @example Apply this class to the Master and any/all Compilers
6
6
# include puppet_metrics_dashboard::profile::master::install
7
7
#
8
- class puppet_metrics_dashboard::profile::master::install {
8
+ class puppet_metrics_dashboard::profile::master::install (
9
+ Boolean $manage_ldap_auth = true ,
10
+ ) {
11
+
9
12
if $facts [' pe_server_version' ] {
10
13
$puppetserver_service = ' pe-puppetserver'
11
14
} else {
12
15
$puppetserver_service = ' puppetserver'
13
16
}
14
17
15
- if $puppet_metrics_dashboard::enable_ldap_auth {
18
+ if $manage_ldap_auth {
16
19
package { 'toml' :
17
20
ensure => present ,
18
21
provider => ' puppetserver_gem' ,
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments