Skip to content

Commit

Permalink
Merge pull request #787 from lbetz/enhancement/empty-strings
Browse files Browse the repository at this point in the history
Restrict params to non-empty strings
  • Loading branch information
lbetz authored Aug 15, 2024
2 parents f7b160c + e3cc356 commit 6cf22c9
Show file tree
Hide file tree
Showing 37 changed files with 543 additions and 543 deletions.
440 changes: 220 additions & 220 deletions REFERENCE.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion manifests/feature.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
define icinga2::feature (
Enum['absent', 'present'] $ensure = present,
String $feature = $title,
String[1] $feature = $title,
) {
assert_private()

Expand Down
16 changes: 8 additions & 8 deletions manifests/feature/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -160,23 +160,23 @@
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'] } },
Hash[String[1], Hash] $endpoints = { 'NodeName' => {} },
Hash[String[1], Hash] $zones = { 'ZoneName' => { endpoints => ['NodeName'] } },
Optional[Icinga::Secret] $ssl_key = undef,
Optional[String] $ssl_cert = undef,
Optional[String] $ssl_cacert = undef,
Optional[String[1]] $ssl_cert = undef,
Optional[String[1]] $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[String[1]] $ssl_cipher_list = undef,
Optional[Stdlib::Host] $bind_host = 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[Array[String[1]]] $access_control_allow_origin = undef,
Optional[Boolean] $access_control_allow_credentials = undef,
Optional[String] $access_control_allow_headers = undef,
Optional[String[1]] $access_control_allow_headers = undef,
Optional[Icinga2::Fingerprint] $fingerprint = undef,
Optional[String] $environment = undef,
Optional[String[1]] $environment = undef,
) {
if ! defined(Class['icinga2']) {
fail('You must include the icinga2 base class before using any icinga2 feature class!')
Expand Down
10 changes: 5 additions & 5 deletions manifests/feature/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Optional[Stdlib::Port] $port = undef,
Optional[String] $index = undef,
Optional[String] $username = undef,
Optional[String[1]] $index = undef,
Optional[String[1]] $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[String[1]] $ssl_cert = undef,
Optional[String[1]] $ssl_cacert = undef,
Optional[Boolean] $enable_send_perfdata = undef,
Optional[Icinga2::Interval] $flush_interval = undef,
Optional[Integer] $flush_threshold = undef,
Optional[Integer[0]] $flush_threshold = undef,
Optional[Boolean] $enable_ha = undef,
) {
if ! defined(Class['icinga2']) {
Expand Down
6 changes: 3 additions & 3 deletions manifests/feature/gelf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Optional[Stdlib::Port] $port = undef,
Optional[String] $source = undef,
Optional[String[1]] $source = undef,
Boolean $enable_ssl = false,
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[String[1]] $ssl_cert = undef,
Optional[String[1]] $ssl_cacert = undef,
Optional[Boolean] $ssl_noverify = undef,
Optional[Boolean] $enable_send_perfdata = undef,
Optional[Boolean] $enable_ha = undef,
Expand Down
4 changes: 2 additions & 2 deletions manifests/feature/graphite.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Optional[Stdlib::Port] $port = undef,
Optional[String] $host_name_template = undef,
Optional[String] $service_name_template = undef,
Optional[String[1]] $host_name_template = undef,
Optional[String[1]] $service_name_template = undef,
Optional[Boolean] $enable_send_thresholds = undef,
Optional[Boolean] $enable_send_metadata = undef,
Optional[Boolean] $enable_ha = undef,
Expand Down
10 changes: 5 additions & 5 deletions manifests/feature/icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
Optional[Stdlib::Absolutepath] $tls_cacert_file = undef,
Optional[Stdlib::Absolutepath] $tls_crl_file = undef,
Optional[Icinga::Secret] $tls_key = undef,
Optional[String] $tls_cert = undef,
Optional[String] $tls_cacert = undef,
Optional[String] $tls_capath = undef,
Optional[String] $tls_cipher = undef,
Optional[String] $tls_protocolmin = undef,
Optional[String[1]] $tls_cert = undef,
Optional[String[1]] $tls_cacert = undef,
Optional[String[1]] $tls_capath = undef,
Optional[String[1]] $tls_cipher = undef,
Optional[String[1]] $tls_protocolmin = undef,
Optional[Boolean] $tls_noverify = undef,
) {
if ! defined(Class['icinga2']) {
Expand Down
16 changes: 8 additions & 8 deletions manifests/feature/idomysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,21 @@
Stdlib::Host $host = 'localhost',
Optional[Stdlib::Port] $port = undef,
Optional[Stdlib::Absolutepath] $socket_path = undef,
String $user = 'icinga',
String $database = 'icinga',
String[1] $user = 'icinga',
String[1] $database = 'icinga',
Optional[Icinga::Secret] $password = undef,
Boolean $enable_ssl = false,
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[String[1]] $ssl_cert = undef,
Optional[String[1]] $ssl_cacert = undef,
Optional[Stdlib::Absolutepath] $ssl_capath = undef,
Optional[String] $ssl_cipher = undef,
Optional[String] $table_prefix = undef,
Optional[String] $instance_name = undef,
Optional[String] $instance_description = undef,
Optional[String[1]] $ssl_cipher = undef,
Optional[String[1]] $table_prefix = undef,
Optional[String[1]] $instance_name = undef,
Optional[String[1]] $instance_description = undef,
Optional[Boolean] $enable_ha = undef,
Optional[Icinga2::Interval] $failover_timeout = undef,
Optional[Icinga2::IdoCleanup] $cleanup = undef,
Expand Down
14 changes: 7 additions & 7 deletions manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,20 @@
Enum['absent', 'present'] $ensure = present,
Stdlib::Host $host = 'localhost',
Optional[Stdlib::Port] $port = undef,
String $user = 'icinga',
String $database = 'icinga',
String[1] $user = 'icinga',
String[1] $database = 'icinga',
Optional[Icinga::Secret] $password = undef,
Optional[Enum['disable', 'allow', 'prefer',
'verify-full', 'verify-ca', 'require']] $ssl_mode = 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[String] $table_prefix = undef,
Optional[String] $instance_name = undef,
Optional[String] $instance_description = undef,
Optional[String[1]] $ssl_cert = undef,
Optional[String[1]] $ssl_cacert = undef,
Optional[String[1]] $table_prefix = undef,
Optional[String[1]] $instance_name = undef,
Optional[String[1]] $instance_description = undef,
Optional[Boolean] $enable_ha = undef,
Optional[Icinga2::Interval] $failover_timeout = undef,
Optional[Icinga2::IdoCleanup] $cleanup = undef,
Expand Down
16 changes: 8 additions & 8 deletions manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Optional[Stdlib::Port] $port = undef,
Optional[String] $database = undef,
Optional[String] $username = undef,
Optional[String[1]] $database = undef,
Optional[String[1]] $username = undef,
Optional[Icinga::Secret] $password = undef,
Optional[Icinga2::BasicAuth] $basic_auth = undef,
Optional[Boolean] $enable_ssl = undef,
Expand All @@ -95,12 +95,12 @@
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,
String $host_measurement = '$host.check_command$',
Hash $host_tags = { hostname => '$host.name$' },
String $service_measurement = '$service.check_command$',
Hash $service_tags = { hostname => '$host.name$', service => '$service.name$' },
Optional[String[1]] $ssl_cert = undef,
Optional[String[1]] $ssl_cacert = undef,
String[1] $host_measurement = '$host.check_command$',
Hash[String[1], String[1]] $host_tags = { hostname => '$host.name$' },
String[1] $service_measurement = '$service.check_command$',
Hash[String[1], String[1]] $service_tags = { hostname => '$host.name$', service => '$service.name$' },
Optional[Boolean] $enable_send_thresholds = undef,
Optional[Boolean] $enable_send_metadata = undef,
Optional[Icinga2::Interval] $flush_interval = undef,
Expand Down
16 changes: 8 additions & 8 deletions manifests/feature/influxdb2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
# Enable the high availability functionality. Only valid in a cluster setup.
#
class icinga2::feature::influxdb2 (
String $organization,
String $bucket,
String[1] $organization,
String[1] $bucket,
Icinga::Secret $auth_token,
Enum['absent', 'present'] $ensure = present,
Optional[Stdlib::Host] $host = undef,
Expand All @@ -91,12 +91,12 @@
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,
String $host_measurement = '$host.check_command$',
Hash $host_tags = { hostname => '$host.name$' },
String $service_measurement = '$service.check_command$',
Hash $service_tags = { hostname => '$host.name$', service => '$service.name$' },
Optional[String[1]] $ssl_cert = undef,
Optional[String[1]] $ssl_cacert = undef,
String[1] $host_measurement = '$host.check_command$',
Hash[String[1], String[1]] $host_tags = { hostname => '$host.name$' },
String[1] $service_measurement = '$service.check_command$',
Hash[String[1], String[1]] $service_tags = { hostname => '$host.name$', service => '$service.name$' },
Optional[Boolean] $enable_send_thresholds = undef,
Optional[Boolean] $enable_send_metadata = undef,
Optional[Icinga2::Interval] $flush_interval = undef,
Expand Down
4 changes: 2 additions & 2 deletions manifests/feature/perfdata.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
Optional[Stdlib::Absolutepath] $service_perfdata_path = undef,
Optional[Stdlib::Absolutepath] $host_temp_path = undef,
Optional[Stdlib::Absolutepath] $service_temp_path = undef,
Optional[String] $host_format_template = undef,
Optional[String] $service_format_template = undef,
Optional[String[1]] $host_format_template = undef,
Optional[String[1]] $service_format_template = undef,
Optional[Icinga2::Interval] $rotation_interval = undef,
Optional[Boolean] $enable_ha = undef,
) {
Expand Down
24 changes: 12 additions & 12 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@
# How to do a reload of the Icinga process.
#
class icinga2::globals (
String $package_name,
String $service_name,
String $ido_mysql_schema,
String $ido_pgsql_schema,
String[1] $package_name,
String[1] $service_name,
String[1] $ido_mysql_schema,
String[1] $ido_pgsql_schema,
Stdlib::Absolutepath $icinga2_bin,
Stdlib::Absolutepath $conf_dir,
Stdlib::Absolutepath $lib_dir,
Expand All @@ -88,14 +88,14 @@
Stdlib::Absolutepath $data_dir,
Stdlib::Absolutepath $cert_dir,
Stdlib::Absolutepath $ca_dir,
Array[String] $reserved,
Optional[String] $user = undef,
Optional[String] $group = undef,
Optional[String] $logon_account = undef,
Optional[String] $selinux_package_name = undef,
Optional[String] $ido_mysql_package_name = undef,
Optional[String] $ido_pgsql_package_name = undef,
Optional[String] $service_reload = undef,
Array[String[1]] $reserved,
Optional[String[1]] $user = undef,
Optional[String[1]] $group = undef,
Optional[String[1]] $logon_account = undef,
Optional[String[1]] $selinux_package_name = undef,
Optional[String[1]] $ido_mysql_package_name = undef,
Optional[String[1]] $ido_pgsql_package_name = undef,
Optional[String[1]] $service_reload = undef,
) {
assert_private()

Expand Down
22 changes: 11 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,17 @@
# with tag icinga2::config::file.
#
class icinga2 (
Array $features,
Array $plugins,
Stdlib::Ensure::Service $ensure = running,
Boolean $enable = true,
Boolean $manage_repos = false,
Boolean $manage_packages = true,
Boolean $manage_selinux = false,
Boolean $manage_service = true,
Boolean $purge_features = true,
Hash $constants = {},
Variant[Boolean, String] $confd = true,
Array[String[1]] $features,
Array[String[1]] $plugins,
Stdlib::Ensure::Service $ensure = running,
Boolean $enable = true,
Boolean $manage_repos = false,
Boolean $manage_packages = true,
Boolean $manage_selinux = false,
Boolean $manage_service = true,
Boolean $purge_features = true,
Hash[String[1], Any] $constants = {},
Variant[Boolean, String[1]] $confd = true,
) {
require icinga2::globals

Expand Down
Loading

0 comments on commit 6cf22c9

Please sign in to comment.