Defined Type: psick::rclocal::script
- Defined in:
- manifests/rclocal/script.pp
Summary
This define creates a single script in /etc/rc.local/.d that is executed by /etc/rc.local at boot timeOverview
Define psick::rclocal::script
Priority influences the execution order while content contains the script to be executed. Can be also a template, had has the same syntax of the content param in the file type.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'manifests/rclocal/script.pp', line 29
define psick::rclocal::script (
Psick::Ensure $ensure = 'present',
String[1] $priority = '50',
Boolean $autoexec = true,
String $content = '', # lint:ignore:params_empty_string_assignment
) {
include psick::rclocal
$safe_name = regsubst($title, '/', '_', 'G')
file { "rclocal_${priority}_${safe_name}":
ensure => $ensure,
path => "${psick::rclocal::config_dir}/${priority}-${safe_name}",
mode => '0755',
owner => 'root',
group => '0',
content => $content,
}
if $autoexec == true and $ensure == 'present' {
exec { "rclocal_${priority}_${safe_name}":
command => "sh ${psick::rclocal::config_dir}/${priority}-${safe_name}",
refreshonly => true,
subscribe => File["rclocal_${priority}_${safe_name}"],
path => '/usr/bin:/bin:/usr/sbin:/sbin',
}
}
}
|