dpeters / puppet-opsview

Puppet types/providers to support Opsview resources
12 stars 10 forks source link

Append Host templates #16

Open AutomationD opened 10 years ago

AutomationD commented 10 years ago

Hi, I really like your module, but I can't figure out if there is a way of appending Host Templates from different manifests? let's say I have several manifests that describe IIS and it has site name parameter, they all have different types and I would like to assign different host templates based on those differences, so eventually it will have all those host templates?

Is there a way/workaround how I can do that?

Thanks in advance!

AutomationD commented 10 years ago

I figured that out, I publish facts by exporting environment variables (FACT_host_template), it gets interpreted on the next run as a fact in my node.pp

My second question, would you plan to implement host attributes? Thank you.

dpeters commented 10 years ago

Glad you found a solution to the host template issue. I haven't used this module (or opsview) for quite some time now, but I'd be curious if using the plussignment operator in puppet would work to add hosttemplates (http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#appending-to-resource-attributes)...

As for host attributes, I had never used them and so never added them. Though, I'm pretty sure that it wouldn't be too difficult. My guess is that you could basically copy and fixup the code used by something like hosttemplates for hostattributes, and it would probably just work. I don't currently have a way to test this, but could probably provide some code for you to test this if you want. Just let me know.