Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created example accounts profile and updated Puppetfile to include pu… #6

Open
wants to merge 1 commit into
base: production
Choose a base branch
from

Conversation

chrismatteson
Copy link

…ppetlabs/accounts

) {


create_resources(accounts::user, $accounts)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrismatteson gross. You have an aversion to puppet 4 iteration?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants