Revision 7a9857ba
Added by Greg Sutcliffe about 12 years ago
manifests/config.pp | ||
---|---|---|
class puppet::config {
|
||
file { $puppet::params::dir:
|
||
file { $puppet::dir:
|
||
ensure => directory,
|
||
}
|
||
file { "${puppet::params::dir}/puppet.conf":
|
||
content => template('puppet/puppet.conf.erb'),
|
||
file { "${puppet::dir}/puppet.conf":
|
||
content => template("$puppet::agent_template"),
|
||
}
|
||
|
||
}
|
manifests/cron.pp | ||
---|---|---|
}
|
||
|
||
cron { 'puppet':
|
||
command => "sleep $((RANDOM%59)) && /usr/sbin/puppet agent --config ${puppet::params::dir}/puppet.conf --onetime --no-daemonize",
|
||
command => "sleep $((RANDOM%59)) && /usr/sbin/puppet agent --config ${puppet::dir}/puppet.conf --onetime --no-daemonize",
|
||
user => root,
|
||
minute => ip_to_cron($puppet::params::cron_interval, $puppet::params::cron_range),
|
||
minute => ip_to_cron($puppet::cron_interval, $puppet::cron_range),
|
||
}
|
||
|
||
}
|
manifests/init.pp | ||
---|---|---|
class puppet {
|
||
include puppet::params
|
||
include puppet::install
|
||
include puppet::config
|
||
class puppet (
|
||
$user = $puppet::params::user,
|
||
$dir = $puppet::params::dir,
|
||
$ca = $puppet::params::ca,
|
||
$passenger = $puppet::params::passenger,
|
||
$port = $puppet::params::port,
|
||
$environments = $puppet::params::environments,
|
||
$modules_path = $puppet::params::modules_path,
|
||
$common_modules_path = $puppet::params::common_modules_path,
|
||
$git_repo = $puppet::params::git_repo,
|
||
$git_repo_path = $puppet::params::git_repo_path,
|
||
$envs_dir = $puppet::params::envs_dir,
|
||
$app_root = $puppet::params::app_root,
|
||
$ssl_dir = $puppet::params::ssl_dir,
|
||
$master_package = $puppet::params::master_package,
|
||
$post_hook_content = $puppet::params::post_hook_content,
|
||
$post_hook_name = $puppet::params::post_hook_name,
|
||
$agent_template = $puppet::params::agent_template,
|
||
$master_template = $puppet::params::master_template
|
||
) inherits puppet::params {
|
||
class { 'puppet::install': }~>
|
||
class { 'puppet::config': }
|
||
}
|
manifests/params.pp | ||
---|---|---|
$dir = '/etc/puppet'
|
||
$ca = true
|
||
$passenger = true
|
||
$port = 8140
|
||
|
||
# Need your own config templates? Specify here:
|
||
$agent_template = 'puppet/puppet.conf.erb'
|
||
$master_template = 'puppet/server/puppet.conf.erb'
|
||
|
||
# Set 'false' for staic environments, or 'true' for git-based workflow
|
||
$git_repo = false
|
manifests/server.pp | ||
---|---|---|
$dir = $puppet::params::dir,
|
||
$ca = $puppet::params::ca,
|
||
$passenger = $puppet::params::passenger,
|
||
$port = $puppet::params::port,
|
||
$environments = $puppet::params::environments,
|
||
$modules_path = $puppet::params::modules_path,
|
||
$common_modules_path = $puppet::params::common_modules_path,
|
||
... | ... | |
$ssl_dir = $puppet::params::ssl_dir,
|
||
$master_package = $puppet::params::master_package,
|
||
$post_hook_content = $puppet::params::post_hook_content,
|
||
$post_hook_name = $puppet::params::post_hook_name
|
||
$post_hook_name = $puppet::params::post_hook_name,
|
||
$agent_template = $puppet::params::agent_template,
|
||
$master_template = $puppet::params::master_template
|
||
) inherits puppet::params {
|
||
class { 'puppet::server::install': }~>
|
||
class { 'puppet::server::config': }
|
manifests/server/config.pp | ||
---|---|---|
|
||
# appends our server configuration to puppet.conf
|
||
File ["${puppet::server::dir}/puppet.conf"] {
|
||
content => template('puppet/puppet.conf.erb', 'puppet/server/puppet.conf.erb'),
|
||
content => template($puppet::server::agent_template, $puppet::server::master_template),
|
||
}
|
||
|
||
exec {'generate_ca_cert':
|
templates/puppet.conf.erb | ||
---|---|---|
localconfig = $vardir/localconfig
|
||
report = true
|
||
pluginsync = true
|
||
masterport = <%= scope.lookupvar("puppet::port") rescue 8140 %>
|
||
environment = <%= environment %>
|
||
server = <%= puppetmaster rescue fqdn %>
|
templates/server/puppet-vhost.conf.erb | ||
---|---|---|
Listen 8140
|
||
<VirtualHost *:8140>
|
||
Listen <%= scope.lookupvar("puppet::server::port") %>
|
||
<VirtualHost *:<%= scope.lookupvar("puppet::server::port") %>>
|
||
|
||
SSLEngine on
|
||
SSLCipherSuite SSLv2:-LOW:-EXPORT:RC4+RSA
|
Also available in: Unified diff
Parameterize the agent half of the module, and enable user to specify the Puppet port