Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/v5.0.0 #762

Merged
merged 24 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f7bdcd4
Remove redundant function icinga2::unwrap
deric Dec 21, 2023
2683e2f
replace newline function against icinga::newline
lbetz Dec 22, 2023
5d84c0d
Add requirement of the icinga module
lbetz Dec 22, 2023
deb0112
Update version to 5.0.0
lbetz Dec 22, 2023
79abd62
Merge branch 'release/v5.0.0' into enhancement/require-icinga-module
lbetz Dec 22, 2023
2127176
Merge pull request #746 from Icinga/enhancement/require-icinga-module
lbetz Dec 22, 2023
de7bd64
Merge pull request #747 from Icinga/enhancement/replace-newline-function
lbetz Dec 22, 2023
0c7347c
Merge branch 'release/v5.0.0' into unwrap
lbetz Dec 22, 2023
0a4450e
Merge pull request #745 from deric/unwrap
lbetz Dec 22, 2023
9f53f91
fix error in merge confilct
lbetz Dec 22, 2023
54a798f
Replace icinga2::db::connect function with icinga::db::connect from m…
lbetz Dec 22, 2023
50f3a59
Merge pull request #748 from Icinga/enhancement/replace-db-connect-fu…
lbetz Dec 22, 2023
0291686
Replace icinga2::cert function wirh icinga::cert::files from icinga m…
lbetz Dec 22, 2023
083d738
Merge pull request #749 from Icinga/enhancement/replace-cert-function
lbetz Dec 22, 2023
d452788
Replace icinga2::tls::client with icinga::cert from icinga module
lbetz Dec 22, 2023
188384b
Merge pull request #750 from Icinga/enhancement/replace-tls-client
lbetz Dec 22, 2023
f8a2495
Use datatype Icinga::Secret from module icinga
lbetz Dec 22, 2023
1327bd9
Merge pull request #751 from Icinga/enhancement/use-datatype-secret
lbetz Dec 22, 2023
6db96df
Use datatype Icinga::LogLevel from module icinga
lbetz Dec 22, 2023
1abcc0c
Merge pull request #752 from Icinga/enhancement/replace-datatype-logs…
lbetz Dec 22, 2023
cdb6467
puppet >= 7.9.0 required
lbetz Apr 25, 2024
8a99f71
fix merge conflicts #760
lbetz Apr 25, 2024
570f1e2
Fix merge conflict - module version
lbetz May 17, 2024
45c8606
Remove obsolet unit test for function db_connect
lbetz May 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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