Defined Type: motd::script
- Defined in:
- manifests/script.pp
Summary
A short summary of the purpose of this defined type.Overview
A description of what this defined type does
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'manifests/script.pp', line 10
define motd::script (
Integer[0, 99] $priority = 50,
Optional[String] $content = undef,
Optional[Stdlib::Filesource] $source = undef,
) {
include motd
if $source == undef and $content == undef {
fail('you must provide either "source" or "content"')
}
if $source != undef and $content != undef {
fail('"source" and "content" are mutually exclusive')
}
$safe_name = regsubst($title, '[\W_]', '-', 'G').downcase
$script = sprintf('%02d-%s', $priority, $safe_name)
file { "/etc/update-motd.d/${script}":
ensure => file,
content => $content,
source => $source,
mode => '0555',
}
}
|