Skip to content

Commit

Permalink
allow 'external' template file for rc.local
Browse files Browse the repository at this point in the history
Signed-off-by: BlackEagle <ike.devolder@gmail.com>
  • Loading branch information
BlackIkeEagle committed Oct 24, 2013
1 parent b1a1585 commit aad5d09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 7 additions & 7 deletions manifests/init.pp
Expand Up @@ -6,23 +6,23 @@
# Usage:
# include rclocal
#
class rclocal {

# Load the variables used in this module. Check the params.pp file
require rclocal::params
class rclocal(
$templatepath = params_lookup( 'templatepath' ),
$templatefile = params_lookup( 'templatefile' )
) inherits rclocal::params {

file { '/etc/rc.local':
ensure => present,
path => $rclocal::params::configfile,
path => $rclocal::configfile,
mode => '0755',
owner => 'root',
group => 'root',
content => template('rclocal/rc.local.erb'),
content => template("${rclocal::templatepath}/${rclocal::templatefile}"),
}

file { '/etc/rc.local.d':
ensure => directory,
path => $rclocal::params::configdir,
path => $rclocal::configdir,
mode => '0755',
owner => 'root',
group => 'root',
Expand Down
4 changes: 4 additions & 0 deletions manifests/params.pp
Expand Up @@ -16,4 +16,8 @@
$configdir = $::operatingsystem ? {
default => '/etc/rc.local.d',
}

# General settings
$templatepath = 'rclocal'
$templatefile = 'rc.local.erb'
}

0 comments on commit aad5d09

Please sign in to comment.