Behavior of exported resource collectors

27 views
Skip to first unread message

Martin Alfke

unread,
Jan 20, 2015, 10:02:40 AM1/20/15
to puppet...@googlegroups.com
Hi,

I have the following code:

define monitor::host (
$target,
$monitortag = $::domain,
) {
}

}

The define gets exported on all nodes:

@@monitor::host { $::fqdn: }

And I collect on the monitor server:

Monitor::Host <<| |>> {
target => ‘/full path to config’,
}

This is working as expected

No I want to collect from a specific monitortag only:

Monitor::Host <<| monitortag == ‘foo.com’ |>> {
target => ‘/full path to config’,
}

Now we receive an error message on the host where we collect claiming that target is not set.

Is this known behaviour?

Many thanks,

Martin

Martin Alfke

unread,
Feb 5, 2015, 3:01:39 AM2/5/15
to puppet...@googlegroups.com
Answering myself on this one:

the described behaviour is expected.
Many thanks to Henrik for his input on this.

Background:

when collecting all exported resources the parser uses a “shortcut” and does not inspect all exported resources.
When collecting a subset only, the parser needs to inspect all exported resources to analyse what to collect and what not.

Fix: set a sane default for all parameters in exported resources.

- Martin
Reply all
Reply to author
Forward
0 new messages