On Monday, September 1, 2014 4:54:31 AM UTC-5, yamaka...@gmail.com wrote: > > Hi guys, > > I'm looking for a solution to svn checkout a branch and directly config > the branch modules using create_resources. > > My yaml would look like this I think for a one time checkout, which will > grab all the modules and configure them one by one: > > > svnsource: > repourl: > branch: > copydir: > repo: > username: > password: > modules: > mymodule1: > servername: > database: > username: > password: > mymodule2: > servername: > database: > username: > password: > mymodule2: > servername: > database: > username: > password: > > How can I do this ? >
What component do you hope will consume your YAML? (Hiera, maybe?) Are the "modules" you're talking about Puppet modules, or some other kind? Are you expecting to do this via the "apply" face or via the "agent" face? For the belance of this post, I'm going to assume that the answers are, in order, "I don't actually care", "Yes, Puppet modules", and "the 'apply' face". > it seems that default or merge doesn't do what I need here. > > Each execution of the create_resources() function creates resources of exactly one type. It takes multiple calls to create resources of multiple types. Moreover, create_resources() is rarely used to declare classes, in part because that's what an external node classifier is for. In fact, what you are describing sounds much like a data-driven external node classifier. It's a little bit wonky to download your Puppet manifests *after* invoking the catalog compiler, but I think you can do it in this one-time mode [I think] you're describing. I suggest that you indeed do approach it by writing an external node classifier that consumes the YAML, performs the SVN checkout into the right location, and emits the desired specifications for classes to apply. It looks like that last bit might just be a subtree of your overall data. I do not think it is wise to try to download Puppet modules for the current Puppet run any time after Puppet has passed the ENC point. John -- 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/312ffc24-4b1b-46bd-b931-43611660af59%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.