John, thanks for your detailed answer! So you are trying to remove unmanaged resources of the specified type? > Puppet has built-in support for that for plugin resource types that meet a > couple of fairly simple criteria. You would even dispense with any need > for facter to be involved if you wrote your type as a (custom) type / > provider pair. >
That seems to be the solution i'm looking for. > > Instead of querying the catalog, you should know independently what > resources of your type are intended to be present. An array of their names > would be suitable. These days, the recommendation would probably be to > maintain that data in Hiera. You then use that both to declare the wanted > resources and to determine (based on the data from Facter) what unwanted > resources are present. Puppet doesn't have a built-in diff() function, but > it shouldn't be too hard to write a custom function to do what you need. > For prototyping, you could probably do it with a combination of > inline_template() to perform the heavy lifting with split() to convert the > template output from string to array. > > I'm actually moving away from hiera. Just to give more context, I have a defined type to manage jenkins jobs that allows us amongst other things to - version jobs in a minimalistic fashion (instead of versioning xml). - build many similar projects by querying stash (using custom functions) My defined type is called 'job_shell' and as I just said can be called multiple times in various places. Bruno -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b46f5b66-401a-4234-a619-a969e5295254%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
