-
Notifications
You must be signed in to change notification settings - Fork 461
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
Class for managing unattended-upgrades #153
Class for managing unattended-upgrades #153
Conversation
This looks good. Would really benefit from some spec tests though. |
As @dcarley said, only thing blocking this is spec tests! |
@apenney Tests were added needs your review. |
It's preferable to use underscores rather than hyphens in class names. Refs: - http://projects.puppetlabs.com/issues/5268 - http://docs.puppetlabs.com/puppet/3/reference/lang_reserved.html#classes-and-types
It would be good to test the default values of the params too. I'll add some more contexts and link you to a branch that you can pull from, if you don't mind? |
Reduce some duplication of long file paths.
For params which have any logic embedded in the template: - origins - blacklist - mail_to - dl_limit
To ensure that the default configs from the package are always overwritten within a single Puppet run.
I've added some additional tests and tweaks here: https://github.com/dcarley/puppetlabs-apt/compare/pr153-unattended_upgrades_patches What do you think? Want to pull them into this PR? |
Looks good! The commits have been pulled in. Thanks for your help! |
@dcarley You happy with the current state of things? I'm looking to merge. :) |
Yep, LGTM. Thanks @drbop As a side note - I did think about whether the options would be better exposed as a single hash. Because it can be tricky to maintain classes with as many params as this. But given the complexity of the key names and that I don't know how apt will behave if some are missing, I think what we have is the right approach. |
Class for managing unattended-upgrades
I love this pull request. It fixes one of the last missing pieces. But it's strange to define a parameter like 'email_to' with the default value of "NONE". undef would work the same and is more common and understood. |
I'm OK with I'm in two minds about the integer values. It is a bit weird and we can't easily do validation. But on the other hand, you probably need to lookup/understand the underlying internals to pick new values, and there are other non-boolean options in the same file. |
unattended-upgrades is an ubuntu package that can automatically install upgradeable packages. This class installs the unattended-upgrades package, and manages the 50unattended-upgrades and 10periodic configuration files.