- included scripts into profiles::base - updated hiera with list of scripts to create and their template name - created template for a puppet wrapper
27 lines
742 B
Puppet
27 lines
742 B
Puppet
# This class can be included directly in node definitions or other classes.
|
|
# The preferred method for declaring the scripts is via Hiera.
|
|
#
|
|
# Here's an example Hiera configuration:
|
|
#
|
|
# profiles::base::scripts::scripts:
|
|
# script1: script1
|
|
# script2: script2
|
|
#
|
|
# This would deploy 'script1' and 'script2' to /usr/local/bin using their
|
|
# respective ERB templates in the profiles/base/scripts directory.
|
|
#
|
|
class profiles::base::scripts (
|
|
Hash $scripts = {},
|
|
) {
|
|
$scripts.each |$script_name, $template_name| {
|
|
file { "/usr/local/bin/${script_name}":
|
|
ensure => file,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0755',
|
|
content => template("profiles/base/scripts/${template_name}.erb"),
|
|
}
|
|
}
|
|
}
|
|
|