Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8391386
puppet_config_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
puppet_config_spec.rb
View Options
require
'spec_helper'
describe
'puppet::config'
do
let
:facts
do
{
:osfamily
=>
'RedHat'
,
:domain
=>
'example.org'
,
}
end
describe
'with default parameters'
do
let
:pre_condition
do
'include ::puppet'
end
it
'should contain auth.conf'
do
should
contain_file
(
'/etc/puppet/auth.conf'
)
.
with_content
(
%r{^path /certificate_revocation_list/ca\nmethod find$}
)
end
it
'should contain puppet.conf [main]'
do
verify_concat_fragment_exact_contents
(
subject
,
'puppet.conf+10-main'
,
[
'[main]'
,
' logdir = /var/log/puppet'
,
' rundir = /var/run/puppet'
,
' ssldir = $vardir/ssl'
,
' privatekeydir = $ssldir/private_keys { group = service }'
,
' hostprivkey = $privatekeydir/$certname.pem { mode = 640 }'
,
' autosign = $confdir/autosign.conf { mode = 664 }'
,
' show_diff = false'
,
' hiera_config = $confdir/hiera.yaml'
]
)
end
end
describe
'with allow_any_crl_auth'
do
let
:pre_condition
do
'class {"::puppet": allow_any_crl_auth => true}'
end
it
'should contain auth.conf with auth any'
do
should
contain_file
(
'/etc/puppet/auth.conf'
)
.
with_content
(
%r{^path /certificate_revocation_list/ca\nauth any$}
)
end
end
context
"when dns_alt_names => ['foo','bar']"
do
let
:pre_condition
do
"class { 'puppet': dns_alt_names => ['foo','bar'] }"
end
it
'should contain puppet.conf [main] with dns_alt_names'
do
verify_concat_fragment_contents
(
subject
,
'puppet.conf+10-main'
,
[
'[main]'
,
' dns_alt_names = foo,bar'
,
]
)
end
end
context
"when hiera_config => '$confdir/hiera.yaml'"
do
let
:pre_condition
do
"class { 'puppet': hiera_config => '/etc/puppet/hiera/production/hiera.yaml' }"
end
it
'should contain puppet.conf [main] with non-default hiera_config'
do
verify_concat_fragment_contents
(
subject
,
'puppet.conf+10-main'
,
[
'[main]'
,
' hiera_config = /etc/puppet/hiera/production/hiera.yaml'
,
]
)
end
end
context
"when use_srv_records => true"
do
let
:pre_condition
do
"class { 'puppet': use_srv_records => true }"
end
it
'should contain puppet.conf [main] with SRV settings'
do
verify_concat_fragment_contents
(
subject
,
'puppet.conf+10-main'
,
[
'[main]'
,
' use_srv_records = true'
,
' srv_domain = example.org'
,
' pluginsource = puppet:///plugins'
,
]
)
end
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Jun 4 2025, 6:42 PM (14 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3398721
Attached To
rSPPUP puppet-theforeman-puppet
Event Timeline
Log In to Comment