1 # == Define: elasticsearch::script
3 # This define allows you to insert, update or delete scripts that are used within Elasticsearch
8 # String. Controls if the managed resources shall be <tt>present</tt> or
9 # <tt>absent</tt>. If set to <tt>absent</tt>:
10 # * The managed software packages are being uninstalled.
11 # * Any traces of the packages will be purged as good as possible. This may
12 # include existing configuration files. The exact behavior is provider
14 # * Puppet type reference: {package, "purgeable"}[http://j.mp/xbxmNP]
15 # * {Puppet's package provider source code}[http://j.mp/wtVCaL]
16 # * System modifications (if any) will be reverted as good as possible
17 # (e.g. removal of created users, services, changed log settings, ...).
18 # * This is thus destructive and should be used with care.
19 # Defaults to <tt>present</tt>.
22 # Puppet source of the script
23 # Value type is string
24 # Default value: undef
25 # This variable is optional
29 # * Richard Pijnenburg <mailto:richard.pijnenburg@elasticsearch.com>
31 define elasticsearch::script(
39 if ! ($ensure in [ 'present', 'absent' ]) {
40 fail("\"${ensure}\" is not a valid ensure parameter value")
43 validate_re($source, '^puppet://')
45 $filenameArray = split($source, '/')
46 $basefilename = $filenameArray[-1]
48 file { "${elasticsearch::configdir}/scripts/${basefilename}":
51 owner => $elasticsearch::elasticsearch_user,
52 group => $elasticsearch::elasticsearch_group,