Is there a way to 'unique-ify' a collection of resources?
Suppose that nodes export '@@nagios_hostgroup' resources for hostgroups
that they want to be a member of. The Nagios server node collect those:
Nagios_hostgroup <<||>>
But many nodes export the same hostgroups, because the whole point of
having hostgroups is, that multiple hosts can be a member :-) So, the
collection would lead to duplicate definitions. Is there a way to avoid that?
Best regards,
Martijn Grendelman
By Googling a bit, and reading some old stuff from the list, I got the
impression that it might be possible to just collect all those resources
without problems. So I set up a simple test case:
class testexport {
@@file {"/tmp/blub":
content => "fiep\n",
}
}
class testcollect {
File <<| tag == "testexport" |>>
}
node serverA {
include testexport
}
node serverB {
include testexport
}
node serverC {
include testcollect
}
As expected, on serverC, this leads to the following error:
err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Exported resource File[/tmp/blub] cannot override local resource on node
serverC
Is there a way around this?
Best regards,
Martijn Grendelman