diff --git a/examples/example4/README.md b/examples/example4/README.md new file mode 100644 index 000000000..eaffa9847 --- /dev/null +++ b/examples/example4/README.md @@ -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)), + } +``` diff --git a/examples/example4/profile/manifests/agent.pp b/examples/example4/profile/manifests/agent.pp index 24120170e..a13601cbd 100644 --- a/examples/example4/profile/manifests/agent.pp +++ b/examples/example4/profile/manifests/agent.pp @@ -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, @@ -48,6 +49,7 @@ } @@::icinga2::object::host { $::fqdn: + # Puppet 4 syntax * => merge({ display_name => $::hostname, address => $agent_ip, diff --git a/examples/example4/profile/manifests/slave.pp b/examples/example4/profile/manifests/slave.pp index a019449a7..0b4006d9c 100644 --- a/examples/example4/profile/manifests/slave.pp +++ b/examples/example4/profile/manifests/slave.pp @@ -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, @@ -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,