Revision ce7bfca7
Added by Michael Moll over 9 years ago
.fixtures.yml | ||
---|---|---|
git: 'https://github.com/theforeman/puppet-git'
|
||
concat_native: 'https://github.com/theforeman/puppet-concat'
|
||
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
|
||
puppetdb: 'https://github.com/puppetlabs/puppetlabs-puppetdb.git'
|
||
intfile: 'https://github.com/puppetlabs/puppetlabs-inifile.git'
|
||
|
||
symlinks:
|
||
puppet: "#{source_dir}"
|
README.md | ||
---|---|---|
* Configurable support for static or git-backed dynamic environments (requires puppet-git module)
|
||
* Storeconfig options (off, ActiveRecord or PuppetDB)
|
||
* Passenger support (requires puppet-apache and puppet-passenger modules)
|
||
* PuppetDB integration (requires puppetlabs-puppetdb module)
|
||
|
||
# Installation
|
||
|
||
... | ... | |
server_post_hook_content => 'puppetserver/post-hook.puppet',
|
||
}
|
||
|
||
# Want to integrate with an existing PuppetDB?
|
||
class { '::puppet':
|
||
server => true,
|
||
server_puppetdb_host => 'mypuppetdb.example.com',
|
||
server_reports => 'puppetdb',
|
||
storeconfigs => true,
|
||
storeconfigs_backend => 'puppetdb',
|
||
}
|
||
|
||
Look in _init.pp_ for what can be configured this way, see Contributing if anything
|
||
doesn't work.
|
||
|
manifests/init.pp | ||
---|---|---|
# --vardir. The default is an empty array.
|
||
# type:array
|
||
#
|
||
# $server_puppetdb_host:: PuppetDB host
|
||
#
|
||
# $server_puppetdb_port:: PuppetDB port
|
||
# type:integer
|
||
#
|
||
# $server_puppetdb_swf:: PuppetDB soft_write_failure
|
||
# type:boolean
|
||
#
|
||
# === Advanced server parameters:
|
||
#
|
||
# $server_httpd_service:: Apache/httpd service name to notify
|
||
... | ... | |
$server_foreman_ssl_key = $puppet::params::client_ssl_key,
|
||
$server_facts = $puppet::params::server_facts,
|
||
$server_puppet_basedir = $puppet::params::server_puppet_basedir,
|
||
$server_puppetdb_host = $puppet::params::server_puppetdb_host,
|
||
$server_puppetdb_port = $puppet::params::server_puppetdb_port,
|
||
$server_puppetdb_swf = $puppet::params::server_puppetdb_swf,
|
||
) inherits puppet::params {
|
||
|
||
validate_bool($listen)
|
||
... | ... | |
validate_bool($server_strict_variables)
|
||
validate_hash($server_additional_settings)
|
||
validate_bool($server_foreman)
|
||
validate_bool($server_puppetdb_swf)
|
||
|
||
validate_string($ca_server)
|
||
validate_string($hiera_config)
|
||
validate_string($server_external_nodes)
|
||
validate_string($server_ca_proxy)
|
||
if $server_puppetdb_host {
|
||
validate_string($server_puppetdb_host)
|
||
}
|
||
|
||
validate_array($listen_to)
|
||
validate_array($dns_alt_names)
|
manifests/params.pp | ||
---|---|---|
Windows : {
|
||
# Windows prefixes normal paths with the Data Directory's path and leaves 'puppet' off the end
|
||
$dir_prefix = 'C:/ProgramData/PuppetLabs/puppet'
|
||
|
||
|
||
$dir = "${dir_prefix}/etc"
|
||
$logdir = "${dir_prefix}/var/log"
|
||
$rundir = "${dir_prefix}/var/run"
|
||
... | ... | |
$server_post_hook_content = 'puppet/server/post-receive.erb'
|
||
$server_post_hook_name = 'post-receive'
|
||
|
||
# PuppetDB config
|
||
$server_puppetdb_host = undef
|
||
$server_puppetdb_port = 8081
|
||
$server_puppetdb_swf = false
|
||
|
||
# Do you use storeconfigs? (note: not required)
|
||
# - undef if you don't
|
||
# - active_record for 2.X style db
|
manifests/server/config.pp | ||
---|---|---|
# setup empty directories for our environments
|
||
puppet::server::env {$puppet::server_environments: }
|
||
}
|
||
|
||
# PuppetDB
|
||
if $puppet::server_puppetdb_host {
|
||
class { 'puppetdb::master::config':
|
||
puppetdb_server => $puppet::server_puppetdb_host,
|
||
puppetdb_port => $puppet::server_puppetdb_port,
|
||
puppetdb_soft_write_failure => $puppet::server_puppetdb_swf,
|
||
manage_storeconfigs => false,
|
||
restart_puppet => false,
|
||
}
|
||
}
|
||
}
|
spec/classes/puppet_server_config_spec.rb | ||
---|---|---|
|
||
should_not contain_file('/etc/puppet/puppet.conf').with_content(/storeconfigs/)
|
||
end
|
||
|
||
it 'should not configure PuppetDB' do
|
||
should_not contain_class('puppetdb')
|
||
should_not contain_class('puppetdb::master::config')
|
||
end
|
||
end
|
||
|
||
describe 'without foreman' do
|
||
... | ... | |
end
|
||
end
|
||
|
||
describe 'with a PuppetDB host set' do
|
||
let :pre_condition do
|
||
"class {'puppet':
|
||
server => true,
|
||
server_puppetdb_host => 'mypuppetdb.example.com',
|
||
server_storeconfigs_backend => 'puppetdb',
|
||
}"
|
||
end
|
||
|
||
it 'should configure PuppetDB' do
|
||
should contain_class('puppetdb::master::config').with({
|
||
:puppetdb_server => 'mypuppetdb.example.com',
|
||
:puppetdb_port => 8081,
|
||
:puppetdb_soft_write_failure => false,
|
||
:manage_storeconfigs => false,
|
||
:restart_puppet => false,
|
||
})
|
||
end
|
||
end
|
||
|
||
describe 'with a puppet git branch map' do
|
||
let :pre_condition do
|
||
"class {'puppet':
|
Also available in: Unified diff
use puppetlabs-puppetdb for Puppet master config