Skip to content

Commit

Permalink
Merge pull request #762 from Icinga/release/v5.0.0
Browse files Browse the repository at this point in the history
Release/v5.0.0
  • Loading branch information
lbetz authored May 17, 2024
2 parents 2adcb7b + 45c8606 commit fc04df0
Show file tree
Hide file tree
Showing 30 changed files with 340 additions and 719 deletions.
178 changes: 43 additions & 135 deletions REFERENCE.md

Large diffs are not rendered by default.

82 changes: 0 additions & 82 deletions functions/cert.pp

This file was deleted.

25 changes: 0 additions & 25 deletions functions/newline.pp

This file was deleted.

16 changes: 0 additions & 16 deletions functions/unwrap.pp

This file was deleted.

8 changes: 2 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
)

if $facts['kernel'] != 'windows' {
$template_constants = icinga2::parse($constants)
$template_mainconfig = $_mainconfig
$file_permissions = '0640'
} else {
$template_constants = regsubst(icinga2::parse($constants), '\n', "\r\n", 'EMG')
$template_mainconfig = regsubst($_mainconfig, '\n', "\r\n", 'EMG')
$file_permissions = undef
}

Expand All @@ -35,12 +31,12 @@

file { "${conf_dir}/constants.conf":
ensure => file,
content => $template_constants,
content => icinga::newline(icinga2::parse($constants)),
}

file { "${conf_dir}/icinga2.conf":
ensure => file,
content => $template_mainconfig,
content => icinga::newline($_mainconfig),
}

file { "${conf_dir}/features-enabled":
Expand Down
20 changes: 7 additions & 13 deletions manifests/config/fragment.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@
String $code_name = $title,
Variant[String, Integer] $order = '00',
) {
case $facts['os']['family'] {
'windows': {
$_content = regsubst($content, '\n', "\r\n", 'EMG')
} # windows
default: {
Concat {
owner => $icinga2::globals::user,
group => $icinga2::globals::group,
mode => '0640',
}
$_content = $content
} # default
if $facts['os']['family'] != 'windows' {
Concat {
owner => $icinga2::globals::user,
group => $icinga2::globals::group,
mode => '0640',
}
}

if !defined(Concat[$target]) {
Expand All @@ -74,7 +68,7 @@

concat::fragment { "icinga2::config::${code_name}":
target => $target,
content => $_content,
content => icinga::newline($content),
order => $order,
}
}
16 changes: 8 additions & 8 deletions manifests/feature/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,20 @@
Optional[Boolean] $accept_commands = undef,
Optional[Integer[0]] $max_anonymous_clients = undef,
Optional[Stdlib::Host] $ca_host = undef,
Stdlib::Port::Unprivileged $ca_port = 5665,
Variant[String, Sensitive[String]] $ticket_salt = 'TicketSalt',
Optional[Variant[String, Sensitive[String]]] $ticket_id = undef,
Stdlib::Port $ca_port = 5665,
Icinga::Secret $ticket_salt = 'TicketSalt',
Optional[Icinga::Secret] $ticket_id = undef,
Hash[String, Hash] $endpoints = { 'NodeName' => {} },
Hash[String, Hash] $zones = { 'ZoneName' => { endpoints => ['NodeName'] } },
Optional[String] $ssl_key = undef,
Optional[Icinga::Secret] $ssl_key = undef,
Optional[String] $ssl_cert = undef,
Optional[String] $ssl_cacert = undef,
Optional[Enum['TLSv1', 'TLSv1.1', 'TLSv1.2', 'TLSv1.3']] $ssl_protocolmin = undef,
Optional[Icinga2::Interval] $ssl_handshake_timeout = undef,
Optional[Icinga2::Interval] $connect_timeout = undef,
Optional[String] $ssl_cipher_list = undef,
Optional[Stdlib::Host] $bind_host = undef,
Optional[Stdlib::Port::Unprivileged] $bind_port = undef,
Optional[Stdlib::Port] $bind_port = undef,
Optional[Array[Enum['GET', 'POST', 'PUT', 'DELETE']]] $access_control_allow_methods = undef,
Optional[Array[String]] $access_control_allow_origin = undef,
Optional[Boolean] $access_control_allow_credentials = undef,
Expand Down Expand Up @@ -252,7 +252,7 @@
file { $_ssl_key_path:
ensure => file,
mode => $_ssl_key_mode,
content => icinga2::newline($ssl_key),
content => icinga::newline($ssl_key),
tag => 'icinga2::config::file',
show_diff => false,
backup => false,
Expand All @@ -262,15 +262,15 @@
if $ssl_cert {
file { $_ssl_cert_path:
ensure => file,
content => icinga2::newline($ssl_cert),
content => icinga::newline($ssl_cert),
tag => 'icinga2::config::file',
}
}

if $ssl_cacert {
file { $_ssl_cacert_path:
ensure => file,
content => icinga2::newline($ssl_cacert),
content => icinga::newline($ssl_cacert),
tag => 'icinga2::config::file',
}
}
Expand Down
61 changes: 37 additions & 24 deletions manifests/feature/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,30 @@
# Enable the high availability functionality. Only valid in a cluster setup.
#
class icinga2::feature::elasticsearch (
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Optional[Stdlib::Port::Unprivileged] $port = undef,
Optional[String] $index = undef,
Optional[String] $username = undef,
Optional[Variant[String, Sensitive[String]]] $password = undef,
Optional[Boolean] $enable_ssl = undef,
Optional[Boolean] $ssl_noverify = undef,
Optional[Stdlib::Absolutepath] $ssl_key_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cert_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cacert_path = undef,
Optional[Variant[String, Sensitive[String]]] $ssl_key = undef,
Optional[String] $ssl_cert = undef,
Optional[String] $ssl_cacert = undef,
Optional[Boolean] $enable_send_perfdata = undef,
Optional[Icinga2::Interval] $flush_interval = undef,
Optional[Integer] $flush_threshold = undef,
Optional[Boolean] $enable_ha = undef,
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Optional[Stdlib::Port] $port = undef,
Optional[String] $index = undef,
Optional[String] $username = undef,
Optional[Icinga::Secret] $password = undef,
Optional[Boolean] $enable_ssl = undef,
Optional[Boolean] $ssl_noverify = undef,
Optional[Stdlib::Absolutepath] $ssl_key_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cert_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cacert_path = undef,
Optional[Icinga::Secret] $ssl_key = undef,
Optional[String] $ssl_cert = undef,
Optional[String] $ssl_cacert = undef,
Optional[Boolean] $enable_send_perfdata = undef,
Optional[Icinga2::Interval] $flush_interval = undef,
Optional[Integer] $flush_threshold = undef,
Optional[Boolean] $enable_ha = undef,
) {
if ! defined(Class['icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
}

$user = $icinga2::globals::user
$owner = $icinga2::globals::user
$group = $icinga2::globals::group
$conf_dir = $icinga2::globals::conf_dir
$ssl_dir = $icinga2::globals::cert_dir
Expand All @@ -104,13 +104,14 @@
}

File {
owner => $user,
owner => $owner,
group => $group,
}

if $enable_ssl {
$cert = icinga2::cert(
$cert = icinga::cert::files(
'ElasticsearchWriter_elasticsearch',
$ssl_dir,
$ssl_key_path,
$ssl_cert_path,
$ssl_cacert_path,
Expand All @@ -127,9 +128,21 @@
'key_path' => $cert['key_file'],
}

icinga2::tls::client { 'ElasticsearchWriter_elasticsearch':
args => $cert,
notify => $_notify,
# Workaround, icinga::cert doesn't accept undef values for owner and group!
if $facts['os']['family'] != 'windows' {
icinga::cert { 'ElasticsearchWriter_elasticsearch':
args => $cert,
owner => $owner,
group => $group,
notify => $_notify,
}
} else {
icinga::cert { 'ElasticsearchWriter_elasticsearch':
args => $cert,
owner => 'foo',
group => 'bar',
notify => $_notify,
}
}
} else {
$attrs_ssl = {
Expand Down
Loading

0 comments on commit fc04df0

Please sign in to comment.