Created example accounts profile and updated Puppetfile to include pu…#6
Created example accounts profile and updated Puppetfile to include pu…#6chrismatteson wants to merge 1 commit intoPuppet-RampUpProgram:productionfrom
Conversation
site/profile/manifests/accounts.pp
Outdated
| ) { | ||
|
|
||
|
|
||
| create_resources(accounts::user, $accounts) |
There was a problem hiding this comment.
@chrismatteson gross. You have an aversion to puppet 4 iteration?
There was a problem hiding this comment.
Lol, well, besides that I generally assumed our goal was probably to maintain 3.x compatibility for this repo for at least the foreseeable future, since accounts::user is already a define type, this took less code to write.
There was a problem hiding this comment.
@chrismatteson this repo is specifically designed for use with code manager so it has a hard dependency on 4.x+. Iteration is slightly more code but significantly more readable :)
There was a problem hiding this comment.
So... looking at writing this with loops. I'm not quite sure how I make this work with a hash:
$accounts.each |Hash $account| {
accounts::user { $account:
???
}
}
But will this pass all the parameters correctly? I'm guessing it wouldn't? Mind giving me guidance? Thanks.
There was a problem hiding this comment.
Here's an example with the host resource.
https://github.com/npwalker/hosts/blob/master/manifests/init.pp
Any parameters that aren't set use default values.
There was a problem hiding this comment.
This seems both like a lot more code, and a lot more brittle since this will need to be updated to match any changes to the acceptable parameters.
…ppetlabs/accounts rewrote accounts profile to utilize iteration
…ppetlabs/accounts