Skip to content

Commit 910543f

Browse files
committed
chore: show correct info when subs are present and added more
doc for each line in the site.pp
1 parent 5895911 commit 910543f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

manifests/site.pp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$obmondo_classes = lookup('classes', Array[String], undef, []).functions::knockout
88

99
# Check if the given class is role::monitoring only.
10-
# If role::monitoring is mixed with other class, then fail
10+
# If role::monitoring is mixed with other role, then fail
1111
if 'role::monitoring' in $obmondo_classes {
1212
if $obmondo_classes.size != 1 {
1313
fail("role::monitoring can not be included with other roles ${obmondo_classes.join(',')}")
@@ -19,9 +19,6 @@
1919
}
2020

2121
# Fail if more than one "unblendable" class is used at once.
22-
#
23-
# Because we're a bit special we only warn if the customer is EnableIT; however
24-
# we should strive to fix this so that we can properly dogfood!
2522
$obmondo_classes.filter |$_class| {
2623
!lookup("${_class}::__blendable", Boolean, undef, false)
2724
}.then |$_obmondo_unblendable_classes| {
@@ -55,7 +52,7 @@
5552
default => 'disabled',
5653
}
5754

58-
$_has_tags = case $obmondo_tags {
55+
$_has_tags = $obmondo_tags ? {
5956
Array => $obmondo_tags.delete_undef_values.empty,
6057
default => []
6158
}
@@ -66,7 +63,7 @@
6663
| EOT
6764
}
6865

69-
$_subs_info = if $obmondo_monitoring_status {
66+
$_subs_info = if $subscription {
7067
@("EOT"/$n)
7168
Subscription Level: ${subscription}
7269
| EOT
@@ -82,7 +79,7 @@
8279
info { $_node_info_msg: }
8380

8481
node default {
85-
# Load role when no class is present, but tag is given
82+
# No class or tags is given, ask user to add it
8683
if $obmondo_classes.empty and $_has_tags.size == 0 {
8784
$_role_msg = @("EOT"/$n)
8885

@@ -99,9 +96,13 @@
9996
info { $_role_msg: }
10097
}
10198
102-
if $obmondo_classes.empty and $obmondo_tags.delete_undef_values.size > 0 {
99+
# Load default role when no class is given and has no tags
100+
if $obmondo_classes.empty and $_has_tags.size > 0 {
103101
::role.include
104-
} else {
102+
}
103+
104+
# Load the given role give in the hiera
105+
if !$obmondo_classes.empty {
105106
$obmondo_classes.include
106107
}
107108
}

0 commit comments

Comments
 (0)