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

Refactor environment setup #18

Open
mbrodala opened this issue Mar 11, 2015 · 3 comments
Open

Refactor environment setup #18

mbrodala opened this issue Mar 11, 2015 · 3 comments

Comments

@mbrodala
Copy link
Contributor

ATM environment setup for Composer is spread across init.pp, project.pp and repository.pp.

This should be unified to reduce repetition. Global defaults should be defined in one central location with the option to override them locally for single composer invocations.

Any suggestions on this?

@igalic
Copy link
Contributor

igalic commented Apr 10, 2015

how about the globals pattern as it's used in puppetlabs-postgresql :P

@mbrodala
Copy link
Contributor Author

Got some details on this? On a quick glimpse all I can see is the params pattern.

@igalic
Copy link
Contributor

igalic commented Apr 14, 2015

https://github.com/puppetlabs/puppetlabs-postgresql/#class-postgresqlglobals uses globals for overrides. in the server.pp (which inherits from params, which sets the platform defaults).
the module uses pick(), extensively to make the correct decision).

for complex modules, that still allow people to make overrides, i find this to be a very good pattern.
for less complex modules, a good pattern is also to just merge(), jfryman-nginx uses that.

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

No branches or pull requests

2 participants