Skip to content

Commit d3e5078

Browse files
author
Lennart Betz
authored
Merge pull request #760 from cruelsmith/main
Fix not working object export on not icinga agent or server
2 parents f504de0 + 4fa1705 commit d3e5078

18 files changed

+34
-1
lines changed

manifests/object/apiuser.pp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# permission => 'objects/query/Host',
2727
# filter => '{{ regex("^Linux", host.vars.os) }}'
2828
# },
29-
# {
29+
# {
3030
# permission => 'objects/query/Service',
3131
# filter => '{{ regex("^Linux", host.vars.os) }}'
3232
# },
@@ -70,6 +70,8 @@
7070
Variant[String, Integer] $order = 30,
7171
Variant[Array[String], String] $export = [],
7272
) {
73+
require icinga2::globals
74+
7375
$_password = if $password =~ String {
7476
Sensitive($password)
7577
} elsif $password =~ Sensitive {

manifests/object/checkcommand.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656
Variant[String, Integer] $order = 15,
5757
Variant[Array[String], String] $export = [],
5858
) {
59+
require icinga2::globals
60+
5961
# compose the attributes
6062
$attrs = {
6163
'command' => $command,

manifests/object/checkresultreader.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
Optional[Stdlib::Absolutepath] $spool_dir = undef,
2525
Variant[String, Integer] $order = '05',
2626
) {
27+
require icinga2::globals
28+
2729
# compose the attributes
2830
$attrs = {
2931
'spool_dir' => $spool_dir,

manifests/object/dependency.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
Variant[String, Integer] $order = 70,
9595
Variant[Array[String], String] $export = [],
9696
) {
97+
require icinga2::globals
98+
9799
# compose attributes
98100
$attrs = {
99101
'parent_host_name' => $parent_host_name,

manifests/object/endpoint.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
Variant[String, Integer] $order = 40,
4040
Variant[Array[String], String] $export = [],
4141
) {
42+
require icinga2::globals
4243
$conf_dir = $icinga2::globals::conf_dir
4344

4445
if $target {

manifests/object/eventcommand.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
Variant[String, Integer] $order = 20,
5353
Variant[Array[String], String] $export = [],
5454
) {
55+
require icinga2::globals
56+
5557
# compose the attributes
5658
$attrs = {
5759
'command' => $command,

manifests/object/host.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
Variant[String, Integer] $order = 50,
148148
Variant[Array[String], String] $export = [],
149149
) {
150+
require icinga2::globals
151+
150152
# compose the attributes
151153
$attrs = {
152154
'address' => $address,

manifests/object/hostgroup.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
Variant[String, Integer] $order = 55,
4949
Variant[Array[String], String] $export = [],
5050
) {
51+
require icinga2::globals
52+
5153
if $ignore != [] and $assign == [] {
5254
fail('When attribute ignore is used, assign must be set.')
5355
}

manifests/object/icingaapplication.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
Variant[String, Integer] $order = 5,
6060
Variant[Array[String], String] $export = [],
6161
) {
62+
require icinga2::globals
6263
$conf_dir = $icinga2::globals::conf_dir
6364

6465
# set defaults

manifests/object/notification.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
Variant[String, Integer] $order = 85,
108108
Variant[Array[String], String] $export = [],
109109
) {
110+
require icinga2::globals
111+
110112
if $ignore != [] and $assign == [] {
111113
fail('When attribute ignore is used, assign must be set.')
112114
}

manifests/object/notificationcommand.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
Variant[String, Integer] $order = 25,
5858
Variant[Array[String], String] $export = [],
5959
) {
60+
require icinga2::globals
61+
6062
# compose attributes
6163
$attrs = {
6264
'command' => $command,

manifests/object/scheduleddowntime.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
Variant[String, Integer] $order = 90,
7474
Variant[Array[String], String] $export = [],
7575
) {
76+
require icinga2::globals
77+
7678
# compose attributes
7779
$attrs = {
7880
'host_name' => $host_name,

manifests/object/service.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@
188188
Variant[String, Integer] $order = 60,
189189
Variant[Array[String], String] $export = [],
190190
) {
191+
require icinga2::globals
192+
191193
# compose the attributes
192194
$attrs = {
193195
'display_name' => $display_name,

manifests/object/servicegroup.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
Variant[String, Integer] $order = 65,
4949
Variant[Array[String], String] $export = [],
5050
) {
51+
require icinga2::globals
52+
5153
# compose attributes
5254
$attrs = {
5355
'display_name' => $display_name,

manifests/object/timeperiod.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252
Variant[String, Integer] $order = 35,
5353
Variant[Array[String], String] $export = [],
5454
) {
55+
require icinga2::globals
56+
5557
# compose attributes
5658
$attrs = {
5759
'display_name' => $display_name,

manifests/object/user.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
Variant[String, Integer] $order = 75,
7373
Variant[Array[String], String] $export = [],
7474
) {
75+
require icinga2::globals
76+
7577
# compose attributes
7678
$attrs = {
7779
'display_name' => $display_name,

manifests/object/usergroup.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
Variant[String, Integer] $order = 80,
4949
Variant[Array[String], String] $export = [],
5050
) {
51+
require icinga2::globals
52+
5153
if $ignore != [] and $assign == [] {
5254
fail('When attribute ignore is used, assign must be set.')
5355
}

manifests/object/zone.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
Variant[String, Integer] $order = 45,
3838
Variant[Array[String], String] $export = [],
3939
) {
40+
require icinga2::globals
4041
$conf_dir = $icinga2::globals::conf_dir
4142

4243
# set defaults

0 commit comments

Comments
 (0)