Skip to content

Commit

Permalink
Updated Puppet::init to support specifying a runmode:
Browse files Browse the repository at this point in the history
* Added a $runmode param which defaults to 'service'.
* Created paramater in init class. 
* Added a case statement to config class to include relevant class based
on runmode value.
  • Loading branch information
fatmcgav committed Mar 12, 2013
1 parent 7304901 commit 45211ba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@
content => template($puppet::nsauth_template),
}
}

case $puppet::runmode {
'service': {
class {'::puppet::daemon':}
}
'cron': {
class {'::puppet::cron':}
}
default: {
fail("Runmode of ${puppet::runmode} not supported by puppet::config!")
}
}
}
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$pluginsync = $puppet::params::pluginsync,
$splay = $puppet::params::splay,
$runinterval = $puppet::params::runinterval,
$runmode = $puppet::params::runmode,
$environments = $puppet::params::environments,
$modules_path = $puppet::params::modules_path,
$common_modules_path = $puppet::params::common_modules_path,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
$pluginsync = true
$splay = false
$runinterval = '1800'
$runmode = 'service'

# Need your own config templates? Specify here:
$agent_template = 'puppet/puppet.conf.erb'
Expand Down

0 comments on commit 45211ba

Please sign in to comment.