On Thursday, February 13, 2014 4:23:27 PM UTC+1, jcbollinger wrote: I think so. This looks related to > https://tickets.puppetlabs.com/browse/PUP-1045. >
Uhm… thanks! So the problem is that defaults only apply when the specified attributes are empty for the affected resources; but some tags are always present by default, so you cannot assign default tags. …actually, I have to say this looks like an inconsistency, and it should be ideally fixed, like the comment on that issue states. Tags are special attributes after all, you cannot replace them (right?), your tags are always appended to the already existing ones instead of replacing them, so tags in resource defaults should have the same behavior. Moreover, resources get automatic tags that may support what you're after > even easier than what you're trying to do. > Yes, I discovered this while searching for solutions to my problem. I guess I will need to try this way now. Do note, however, that what you're specifically doing seems questionable, > in that you are declaring many relationships that you probably don't need. > For example, suppose your class manages both NTP and Puppet. You may have > users 'ntp' and 'puppet', files '/etc/ntp.conf' and > '/etc/puppet/puppet.conf', and services 'ntp' and 'puppet'. Why do you > need a relationship between User['ntp'] and File['/etc/puppet/puppet.conf']? > > Unneeded relationships invite trouble. They make resource cycles more > likely, and they make resource failures more impactful than they need to > be. They may also make your catalogs larger and your Puppet runtimes > longer. > I know this has some logic problems, but I wanted to keep manifests clean. For example, I have some files which need to be put in place before the related services are started, so instead of creating lots of file->service pairs I collected all services in a single resource in condensed form, which will be applied after all files are ready. Thanks. Marco -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/a6bba856-7f94-4877-b91b-a9b738bb5c21%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.