Issue #10917 has been updated by Stephan Eckweiler.
Thanks for looking into this, Daniel. Yes, you’re describing what I actually want to do pretty accurately. I’m using the concat module right now to do this job, which is working fine, it’s just giving me some disadvantages because I don’t have everything available inside one array, but it is cat-ing it all together from different file snippets, so I can’t put every entry into the same line for example. Fortunately that’s not necessary in this case but I’m sure it is in some cases. I actually wouldn’t mind using the syntax I described for it. It’s pretty straight forward (just 2 lines) and it’s all already there. In fact, although you say it is in the land of undefined behaviour, I reckon you won’t get around either fixing this or throwing some kind of syntax error, since the individual language elements are there and all documented (Note if you decide to throw a syntax error you would probably also have to break it for the non-define-based ones to keep it consistent). What I want to say is we shouldn’t make this a feature for something new, but keep it as a bug. Hope you agree? ---------------------------------------- Bug #10917: Virtual Define-based resources collect only once. Inconsistent with non-define-based resources https://projects.puppetlabs.com/issues/10917 Author: Stephan Eckweiler Status: Investigating Priority: Normal Assignee: Daniel Pittman Category: parser Target version: Affected Puppet version: 2.7.5 Keywords: Branch: Executive summary: If I use the spaceship operator with an attached {} block to add additional attributes to an option of a define-based resource, then the first spaceship operater found will finalize the content of the option, and following spaceship operators won't be considered. When doing the same for non-define based resources, it works fine. I understand that "realize" suggests that the first hit found should already realize it once and for all, but that works against the declarative nature of puppet, and against the concept of a "collection". "Collection" (a.k.a Spaceship Operator) suggests that it goes through everywhere, collects all the attributes, and then commits them. So "realize" and "collection" are semantically 2 different things. Detailed description: (as discussed here: http://groups.google.com/group/puppet-users/browse_thread/thread/c11fd64f4953a8b4/08ce80332430f90c#08ce80332430f90c) A module that is responsible to roll out and configure TSM (a backup tool). Basically I need a text file that mentions all directories that have to be backed up. I want to make it a virtual resource and let other modules configure which parts of it have to be backed up, e.g. configure in the apache module that the apache logs of each defined virtual server have to be backed up: The node.pp is configured like this: <pre> apache::config {"virtualserver1": blah } apache:config {"virtualserver2": blah } @tsm::config { "$hostname": tsm_backup => ["/custdir1","/custdir2"] } </pre> The @ means this is a virtual Define-based resource, so it is not implemented until it gets realized. /custdir1 and /custdir2 denote custom directories that have to be backed up, but aren't managed by other puppet modules. One module is supposed to add some directories to tsm_backup, I use this configuration inside the apache module's config.pp: <pre> Tsm::Config<| title == $hostname |> { tsm_backup +> ["$apache_logs,$docroot], } </pre> I can then use this array in the template for the conf file (dsm.sys, virtualmountpoint and Domain, for those who know TSM). Up until here it all works fine. The config file will contain /custdir1, /custdir2, / apache/virtualserver1/logs, /apache/virtualserver2/logs, apache/ virtualserver1/docroot, apache/virtualserver2/docroot But when I want to configure another module to also add its directories to tsm_backup, so basically have another module, say postfix config.pp which contains this: <pre> Tsm::Config<| title == $hostname |> { tsm_backup +> ["$postfix_logs], } </pre> It will either contain the apache backup dirs OR the postfix backup dirs, depending on which `<| |>` it finds first, but never both. If I use the same construct for non-define-based virtual resources, like for a user's groups, it works fine. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
