-
-
Notifications
You must be signed in to change notification settings - Fork 314
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
Lint, style, and parameter data types #476
Conversation
@natemccurdy can you please rebase? |
@bastelfreak Yup! Thanks for reviewing so quickly. Rebased and pushed 👍 |
This commit adds parameter data types to the main classes and defines. It also moves any static parameter defaults from params.pp to init.pp. It's generally better to have static defaults in init.pp and leave params.pp for any defaults that are calculated. This makes it easier to see parameter default values when using the console in Puppet Enterprise as well as reduces the amount of page flipping someone has to do when casually browsing the code.
Thanks for the work @natemccurdy ! |
The change of consul::service port parameter type has broken my use of hiera lookup() for my ports
What are your thoughts on reverting port back to a string value? |
@pahoughton-sf The agate::port: 4464
agate::consul_svc:
agate:
port: "%{alias('agate::port')}"
meta:
example: value Does that work for you? If not, I could submit a PR that opens up the type restriction to allow Integers or Strings, but I'd prefer not to. Mainly because the standard type for a port range is generally an Integer: For reference, here's a type that allows integers and strings that look like numbers: |
The alias will work perfect for my use case. Thanks! |
Lint, style, and parameter data types
This PR fixes various style issues that I've had to fix internally and figured I should share them upstream:
params.pp
only for calculating default values, not static values.facts
hash where possible.dig()
instead of checking for sub-key existence in a Hash.