Defined Type: elasticsearch::script
- Defined in:
- manifests/script.pp
Overview
Define: elasticsearch::script
This define allows you to insert, update or delete scripts that are used within Elasticsearch
Parameters
- ensure
-
String. Controls if the managed resources shall be
present
orabsent
. If set toabsent
:-
The managed software packages are being uninstalled.
-
Any traces of the packages will be purged as good as possible. This may include existing configuration files. The exact behavior is provider dependent. Q.v.:
-
Puppet type reference: package, “purgeable”
-
-
System modifications (if any) will be reverted as good as possible (e.g. removal of created users, services, changed log settings, …).
-
This is thus destructive and should be used with care.
Defaults to
present
. -
- source
-
Puppet source of the script Value type is string Default value: undef This variable is mandatory
Authors
-
Richard Pijnenburg <richard.pijnenburg@elasticsearch.com>
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 |
# File 'manifests/script.pp', line 31
define elasticsearch::script(
$source,
$ensure = 'present',
) {
require elasticsearch
# ensure
if ! ($ensure in [ 'present', 'absent' ]) {
fail("\"${ensure}\" is not a valid ensure parameter value")
}
validate_re($source, '^(puppet|file)://')
$filename_array = split($source, '/')
$basefilename = $filename_array[-1]
file { "${elasticsearch::params::homedir}/scripts/${basefilename}":
ensure => $ensure,
source => $source,
owner => $elasticsearch::elasticsearch_user,
group => $elasticsearch::elasticsearch_group,
mode => '0644',
}
}
|