diff --git a/manifests/init.pp b/manifests/init.pp index 784bd3f..43240a0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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', diff --git a/manifests/params.pp b/manifests/params.pp index 8f1d37b..7e0a570 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -16,4 +16,8 @@ $configdir = $::operatingsystem ? { default => '/etc/rc.local.d', } + + # General settings + $templatepath = 'rclocal' + $templatefile = 'rc.local.erb' }