Skip to content

Commit

Permalink
fix voxpupuli#234 add a commont that this example is only for puppet 4
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz authored and n00by committed Apr 26, 2018
1 parent 7fd9a11 commit e681738
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/example4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
NOTICE: This example is for Puppet 4 only.

The following syntax that's used in profile::icinga2::agent and profile::icinga2::slave is for Puppet 4.
```
@@::icinga2::object::host { $::fqdn:
* => merge({
display_name => $::hostname,
address => $agent_ip,
target => "/etc/icinga2/zones.d/${parent_zone}/${::hostname}.conf",
}, hiera_hash(icinga2::host)),
}
```
2 changes: 2 additions & 0 deletions examples/example4/profile/manifests/agent.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Notice: this code contains Puppet 4 syntax! It doesn't run on Puppet 3.
class profile::icinga2::agent(
$parent_endpoints,
$parent_zone,
Expand Down Expand Up @@ -48,6 +49,7 @@
}

@@::icinga2::object::host { $::fqdn:
# Puppet 4 syntax
* => merge({
display_name => $::hostname,
address => $agent_ip,
Expand Down
2 changes: 2 additions & 0 deletions examples/example4/profile/manifests/slave.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Notice: this code contains Puppet 4 syntax! It doesn't run on Puppet 3.
class profile::icinga2::slave(
$slave_zone,
$parent_endpoints,
Expand Down Expand Up @@ -64,6 +65,7 @@
::Icinga2::Object::Zone <<| tag == "icinga2::parent::${slave_zone}" |>>

@@::icinga2::object::host { $::fqdn:
# Puppet 4 syntax
* => deep_merge({
display_name => $::hostname,
address => $slave_ip,
Expand Down

0 comments on commit e681738

Please sign in to comment.