puppet-foreman/manifests/puppetmaster.pp @ d14d6767
fbf57a7a | Ewoud Kohl van Wijngaarden | # This class includes the necessary scripts for Foreman on the puppetmaster and
|
|
# is intented to be added to your puppetmaster
|
|||
ed7c8f63 | Ewoud Kohl van Wijngaarden | class foreman::puppetmaster (
|
|
$foreman_url = $foreman::params::foreman_url,
|
|||
d4003cc3 | Ewoud Kohl van Wijngaarden | $reports = $foreman::params::reports,
|
|
$enc = $foreman::params::enc,
|
|||
ed7c8f63 | Ewoud Kohl van Wijngaarden | $facts = $foreman::params::facts,
|
|
$puppet_home = $foreman::params::puppet_home,
|
|||
7697116c | Dominic Cleal | $puppet_basedir = $foreman::params::puppet_basedir,
|
|
$ssl_ca = $foreman::params::client_ssl_ca,
|
|||
$ssl_cert = $foreman::params::client_ssl_cert,
|
|||
9d798147 | Greg Sutcliffe | $ssl_key = $foreman::params::client_ssl_key,
|
|
$enc_api = 'v2',
|
|||
$report_api = 'v2'
|
|||
ed7c8f63 | Ewoud Kohl van Wijngaarden | ) inherits foreman::params {
|
|
1246d0fd | Erik Dalén | ||
9d798147 | Greg Sutcliffe | case $::operatingsystem {
|
|
d14d6767 | Clemens Bergmann | 'Debian','Ubuntu': {
|
|
f81d0b1d | Greg Sutcliffe | case $::lsbdistcodename {
|
|
'squeeze': { $json_package = 'libjson-ruby' }
|
|||
default: { $json_package = 'ruby-json' }
|
|||
}
|
|||
}
|
|||
9d798147 | Greg Sutcliffe | default: { $json_package = 'rubygem-json' }
|
|
}
|
|||
package { $json_package:
|
|||
ensure => installed,
|
|||
}
|
|||
d4003cc3 | Ewoud Kohl van Wijngaarden | if $reports { # foreman reporter
|
|
9d798147 | Greg Sutcliffe | ||
081eb96a | Jan Vansteenkiste | exec { 'Create Puppet Reports dir':
|
|
command => "/bin/mkdir -p ${puppet_basedir}/reports",
|
|||
5d3df572 | Greg Sutcliffe | creates => "${puppet_basedir}/reports"
|
|
}
|
|||
ed7c8f63 | Ewoud Kohl van Wijngaarden | file {"${puppet_basedir}/reports/foreman.rb":
|
|
d4003cc3 | Ewoud Kohl van Wijngaarden | mode => '0644',
|
|
owner => 'root',
|
|||
group => 'root',
|
|||
9d798147 | Greg Sutcliffe | content => template("foreman/foreman-report_${report_api}.rb.erb"),
|
|
d4003cc3 | Ewoud Kohl van Wijngaarden | require => Exec['Create Puppet Reports dir'],
|
|
1246d0fd | Erik Dalén | }
|
|
}
|
|||
d4003cc3 | Ewoud Kohl van Wijngaarden | if $enc {
|
|
ed7c8f63 | Ewoud Kohl van Wijngaarden | class {'foreman::config::enc':
|
|
d4003cc3 | Ewoud Kohl van Wijngaarden | foreman_url => $foreman_url,
|
|
facts => $facts,
|
|||
puppet_home => $puppet_home,
|
|||
ssl_ca => $ssl_ca,
|
|||
ssl_cert => $ssl_cert,
|
|||
9d798147 | Greg Sutcliffe | ssl_key => $ssl_key,
|
|
enc_api => $enc_api,
|
|||
ed7c8f63 | Ewoud Kohl van Wijngaarden | }
|
|
}
|
|||
1246d0fd | Erik Dalén | }
|