Page MenuHomePhabricator
Paste P6579

IRC
ActivePublic

Authored by Eevans on Jan 11 2018, 5:01 PM.
Tags
None
Referenced Files
F12480809:
Jan 11 2018, 5:01 PM
Subscribers
None
11:35 < _joe_> urandom: puppet 4 has loops
11:35 <+urandom> and then, there is also a common parent directory that needs to be created as well (though i think that is more straightforward)
11:36 < _joe_> $directories.each |$directory| { <do what you need with $directory> }
11:36 < _joe_> so you can just cycle through them
11:42 <+urandom> _joe_: it's probably a mistake to be asking this before getting my head back into the module, but i think the confusion came from trying to do this with a file/ensure, you can use a loop there, can you?
11:42 <+urandom> s/you can/you can't/
11:42 < _joe_> urandom: you can do things like this, lemme show you
11:44 < _joe_> https://gerrit.wikimedia.org/r/#/c/403388/7/modules/puppetmaster/manifests/puppetdb/database.pp,sidebyside line 61 of the new code
11:44 < _joe_> there $puppetdb_users is a hash
11:44 < _joe_> but say you have a list of directories
11:45 < _joe_> and of each of those you have to create the parent too
11:45 < _joe_> you could just do a similar loop and declare the parents via a file resource

Event Timeline

Eevans changed the title of this paste from untitled to IRC.