Revision 23b7e7d6
Added by Marek Hulán almost 10 years ago
manifests/init.pp | ||
---|---|---|
# $client_package:: Install a custom package to provide
|
||
# the puppet client
|
||
#
|
||
# $puppetmaster:: Hostname of your puppetmaster (server
|
||
# directive in puppet.conf)
|
||
#
|
||
# == puppet::server parameters
|
||
#
|
||
# $server:: Should a puppet master be installed as well as the client
|
||
... | ... | |
$allow_any_crl_auth = $puppet::params::allow_any_crl_auth,
|
||
$client_package = $puppet::params::client_package,
|
||
$agent = $puppet::params::agent,
|
||
$puppetmaster = $puppet::params::puppetmaster,
|
||
$server = $puppet::params::server,
|
||
$server_user = $puppet::params::user,
|
||
$server_group = $puppet::params::group,
|
manifests/params.pp | ||
---|---|---|
# Will this host be a puppet agent ?
|
||
$agent = true
|
||
|
||
# Custom puppetmaster
|
||
$puppetmaster = $::puppetmaster
|
||
|
||
# Will this host be a puppetmaster?
|
||
$server = false
|
||
$server_vardir = '/var/lib/puppet'
|
spec/classes/puppet_agent_spec.rb | ||
---|---|---|
|
||
describe 'puppet::agent' do
|
||
|
||
let :facts do {
|
||
:clientcert => 'puppetmaster.example.com',
|
||
:concat_basedir => '/nonexistant',
|
||
:fqdn => 'puppetmaster.example.com',
|
||
:operatingsystemrelease => '6.5',
|
||
:osfamily => 'RedHat',
|
||
} end
|
||
let :default_facts do
|
||
{
|
||
:clientcert => 'puppetmaster.example.com',
|
||
:concat_basedir => '/nonexistant',
|
||
:fqdn => 'puppetmaster.example.com',
|
||
:operatingsystemrelease => '6.5',
|
||
:osfamily => 'RedHat',
|
||
}
|
||
end
|
||
|
||
let :facts do
|
||
default_facts
|
||
end
|
||
|
||
describe 'with no custom parameters' do
|
||
let :pre_condition do
|
||
... | ... | |
with_content(/^\[agent\]/).
|
||
with({})
|
||
end
|
||
|
||
it do
|
||
should contain_concat_fragment('puppet.conf+20-agent').
|
||
with_content(/server.*puppetmaster\.example\.com/)
|
||
end
|
||
end
|
||
|
||
describe 'puppetmaster parameter overrides server fqdn' do
|
||
let(:pre_condition) { "class {'puppet': agent => true, puppetmaster => 'mymaster.example.com'}" }
|
||
it do
|
||
should contain_concat_fragment('puppet.conf+20-agent').
|
||
with_content(/server.*mymaster\.example\.com/)
|
||
end
|
||
end
|
||
|
||
describe 'global puppetmaster overrides fqdn' do
|
||
let(:pre_condition) { "class {'puppet': agent => true}" }
|
||
let :facts do
|
||
default_facts.merge({:puppetmaster => 'mymaster.example.com'})
|
||
end
|
||
it do
|
||
should contain_concat_fragment('puppet.conf+20-agent').
|
||
with_content(/server.*mymaster\.example\.com/)
|
||
end
|
||
end
|
||
|
||
describe 'puppetmaster parameter overrides global puppetmaster' do
|
||
let(:pre_condition) { "class {'puppet': agent => true, puppetmaster => 'mymaster.example.com'}" }
|
||
let :facts do
|
||
default_facts.merge({:puppetmaster => 'global.example.com'})
|
||
end
|
||
it do
|
||
should contain_concat_fragment('puppet.conf+20-agent').
|
||
with_content(/server.*mymaster\.example\.com/)
|
||
end
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
Allow custom puppetmaster value