Defined Type: elasticsearch::ilm_policy
- Defined in:
- manifests/ilm_policy.pp
Overview
This define allows you to insert, update or delete Elasticsearch ILM
policies.
Policy content should be defined through either the `content` parameter
(when passing a hash or json string) or the `source` parameter (when passing
the puppet file URI to a policy json file).
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'manifests/ilm_policy.pp', line 55
define elasticsearch::ilm_policy (
Enum['absent', 'present'] $ensure = 'present',
Optional[String] $api_basic_auth_password = $elasticsearch::api_basic_auth_password,
Optional[String] $api_basic_auth_username = $elasticsearch::api_basic_auth_username,
Optional[Stdlib::Absolutepath] $api_ca_file = $elasticsearch::api_ca_file,
Optional[Stdlib::Absolutepath] $api_ca_path = $elasticsearch::api_ca_path,
String $api_host = $elasticsearch::api_host,
Integer[0, 65535] $api_port = $elasticsearch::api_port,
Enum['http', 'https'] $api_protocol = $elasticsearch::api_protocol,
Integer $api_timeout = $elasticsearch::api_timeout,
Optional[Variant[String, Hash]] $content = undef,
Optional[String] $source = undef,
Boolean $validate_tls = $elasticsearch::validate_tls,
) {
if $content =~ String {
$_content = parsejson($content)
} else {
$_content = $content
}
if $ensure == 'present' and $source == undef and $_content == undef {
fail('one of "file" or "content" required.')
} elsif $source != undef and $_content != undef {
fail('"file" and "content" cannot be simultaneously defined.')
}
es_instance_conn_validator { "${name}-ilm_policy-conn-validator":
server => $api_host,
port => $api_port,
timeout => $api_timeout,
}
-> elasticsearch_ilm_policy { $name:
ensure => $ensure,
content => $_content,
source => $source,
protocol => $api_protocol,
host => $api_host,
port => $api_port,
timeout => $api_timeout,
username => $api_basic_auth_username,
password => $api_basic_auth_password,
ca_file => $api_ca_file,
ca_path => $api_ca_path,
validate_tls => $validate_tls,
}
}
|