Bruno Bieth
2014-May-20 07:41 UTC
[Puppet Users] Retrieve resource names of a given type without using the filesystem
I'd like to do something like this define mytype() {} define delete_mytype() {} mytype { 'a': } mytype { 'b': } mytype { 'c': } $existing_mytypes = # something from facter # but this doesn't work $wanted_mytypes = Mytype <||> Mytype<||> -> Delete_mytype<||> delete_mytype { diff( $existing_mytypes, $wanted_mytypes ) } I believe I could do something along those lines but it creates as many files as mytype invocation : defined mytype() { # persist $name in the filesystem } class prepare_mytypes { # cleanup files created by previous invocation of mytype } Class['prepare_mytypes'] -> Mytype<||> -> Class['remove_old_mytypes'] class remove_old_mytypes { # look for files created by mytype # perform the same diff as explained above } Any idea? -- 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 puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/82f28275-7bc8-4a9e-ac46-84dea0ffe26e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.