-
Notifications
You must be signed in to change notification settings - Fork 328
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
Remove deprecated functionality and prep for 6.0.0 release #332
Conversation
this makes me happy, well done :) |
$authprov = $ntp::params::authprov, | ||
Boolean $broadcastclient, | ||
Tea::Absolutepath $config, | ||
Optional[Tea::Absolutepath] $config_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is Tea::Absolutepath
from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/voxpupuli/puppet-tea ; one of the things I'm not yet 100% sold on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, but yes I'd have expected those in core or stdlib - early days though
Is this a breaking change? ie. only works on puppet >= 4.x ? |
@robinbowes the currently released version of the ntp module works on both puppet 3 and 4. These changes take advantage of puppet 4 features, and drop support for running on puppet 3. The last commit also changes the interface, but work before that will provide support for changing up to the last stage. This is not expected to be all released in one go. |
@@ -9,8 +9,9 @@ | |||
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES", | |||
"dependencies": [ | |||
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 5.0.0"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DavidS what's still being used from puppetlabs/stdlib after this refactor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good question.
puppetlabs-ntp/manifests/params.pp
Line 2 in 6331180
if str2bool($facts['is_virtual']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a comma on this line too, the file is invalid:
Debug: ntp has an invalid and unparsable metadata.json file. The parse error: 399: unexpected token at '{"name":"puppet/tea","version_requirement":"= 0.2.1"}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, there are many a reason why this is REVIEW ONLY ;-)
6331180
to
f60f5bc
Compare
Updated with preliminary template work, more cleanups, rebased to current upstream master |
f60f5bc
to
9f765c0
Compare
0692f3b
to
64db8cd
Compare
I am in the process of migrating from 3.8 to 2015.2. I am checking my current catalog against the Puppet 4 parser using the catalog_preview module. The catalog_preview module outputs a warning:
This warning is described here. It looks like validate_re() could be used instead of the "if" conditional with the "in" comparison. |
@corbyshaner ah, good catch! Thanks for pointing that out. |
@@ -0,0 +1,54 @@ | |||
--- | |||
ntp::authprov: ~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the tilde here some special meaning? (undef?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nil
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. ~
translates to ruby nil
, which is undef
in the puppet4 ruby api.
On 3 August 2016 at 15:57, Alessandro Franceschi [email protected]
wrote:
In data/common.yaml
#332 (comment)
:@@ -0,0 +1,54 @@
+---
+ntp::authprov: ~Has the tilde here some special meaning? (undef?)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/puppetlabs/puppetlabs-ntp/pull/332/files/64db8cd4fd3d437b79e8d8802d64fdc0420a2a4d#r73346135,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABsQE681uJmD67iJhNyc8bfVt-gOcqwks5qcKx3gaJpZM4JBM8x
.
b87a645
to
1515af2
Compare
This is shaping up to become the final version (except for fixing https://tickets.puppetlabs.com/browse/MODULES-3852). If you want to have another look, now would be the time. See #335 (or just the second to last commit) for what will released as the intermediate 5.0.0 release. |
Optional[String] $authprov, | ||
) { | ||
# defaults for tinker and panic are different, when running on virtual machines | ||
if str2bool($facts['is_virtual']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one should already be a boolean no need for str2bool
1515af2
to
a3291d8
Compare
a24dbdd
to
eea5e2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ade a pass through the recent changes - Looks great! I made a few comments, which are mostly for visibility to other people rather than problems that would block merge/release. Fantastisch @DavidS
## Supported Releases 5.0.0 and 6.0.0 | ||
### Summary | ||
|
||
This double release adds new Puppet 4 features: data in modules, EPP templates, the $facts hash, and data types. The 5.0.0 release is fully backwards compatible to existing Puppet 4 configurations and provides you with [deprecation warnings](https://github.com/puppetlabs/puppetlabs-stdlib#deprecation) for every argument that will not work as expected with the final 6.0.0 release. See the [stdlib docs](https://github.com/puppetlabs/puppetlabs-stdlib#validate_legacy) for an in-depth discussion of this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be: "the 5.0 release is fully backwards compatible to existing Puppet 3 configurations" ...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v5 drops puppet3 support, as none of the newly used puppet 4 features are available there. Folks need to get off puppet3 before they can use any of this.
Do I need to be more explicit about that?
@@ -117,5 +70,4 @@ | |||
class { '::ntp::config': } ~> | |||
class { '::ntp::service': } -> | |||
anchor { 'ntp::end': } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these anchors still required, given the existence of contain
? (If so I would consider that a bug/need for enhancement in contain
) contain function doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. I'll have to investigate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without having it run, the solution might look like this:
contain('ntp::config')
contain('ntp::service')
Class['ntp::config'] ~> Class['ntp::service']
I'm not sure I like that much better. I've created MODULES-3917 to follow up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's crappy for sure, since 4.8 you'll be able to do:
contain("foo") -> contain("bar") ~> contain("baz")
which will make things a lot better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shiny, but very tight version constraint. :-/ @ahpook what's your opinion on switching the puppet version requirement from >=4.5 to >=4.8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO the refresh of services when configs changes should be a behaviour, enabled by default, that users must be able to change, via a class parameter. There can be situations (probably it's not the case for ntpd, but can be valid for other services) where an immediate restart of the service is not desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a pinch, you can always set ntp::service_manage
to false
to avoid this, and replicate the service resource. I know that is not a optimal solution, but the main focus of this patch set is not changing anything, as perverse as that may sound.
"author": "Puppet Labs", | ||
"summary": "Installs, configures, and manages the NTP service.", | ||
"license": "Apache-2.0", | ||
"source": "https://github.com/puppetlabs/puppetlabs-ntp", | ||
"project_page": "https://github.com/puppetlabs/puppetlabs-ntp", | ||
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES", | ||
"dependencies": [ | ||
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 5.0.0"} | ||
{ "name":"puppetlabs/stdlib","version_requirement":">= 4.13.0 < 5.0.0" }, | ||
{ "name":"puppet/tea","version_requirement":">= 0" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, as puppet-tea
is a tiny, experimental module, and it's below 1.0 so no API guarantees, perhaps it'd be better to define the type aliases here inside ntp, and eliminate this dependency? alternately maybe we could pull those aliases over into stdlib or some place that they will get visibility and use but not restrict puppet-tea
from changing API? // cc @igalic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked to @igalic offline and we decided to start pulling those types into stdlib. We'll start out with the easy ones: paths, and URLs, and we'll see from there.
MODULES-3919
tinker<% if $ntp::_panic { %> panic <%= $ntp::_panic %><% } %><%if $ntp::stepout { %> stepout <%=$ntp::stepout %><% } %> | ||
<% } -%> | ||
|
||
<% if $ntp::disable_monitor {-%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't seen this construct in use before and {-%>
is an aummm... "unusual" sigil sequence. I understand how it got there but, wow. // cc @loriland
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would { -%>
(with a space) be better? I'm totally up for fixing style in the last minute. I need to do a pass at outstanding PRs and rebase this AGAIN anyways 😩 .
ntp::tos_minsane: 1 | ||
ntp::tos: false | ||
ntp::udlc_stratum: 10 | ||
ntp::udlc: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really the way to go? One class parameter for every possible configuration directive of the managed application?
What happens when a new release of an application adds new directives? You need to update the module and always catch up the upstream software.
What's the performance impact when there are a LOT of such parameters?
Thanks God at least here we have a parameter that allows users to provide custom templates (I find modules that don't offer a similar parameter inherently broken).
If it were for me templates+options hash pattern for the win!
But I've heretic opinions, probably :-D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An option hash implies no validation, no type hints, no discoverability of available options, no validation of whats provided.
Makes sense sometimes sure, but when its a fairly fixed thing with a large % of known options, stating them wins :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To the options hash, I have talked to puppet users who see the params list as one of the huge advantages of puppet over hand-crafting the config file, because it is a unified syntax, order-independent, and tested. My current PoV is that having the template/epp params for folks who "know better" is essential for maximum flexibility, but the main value of a module lies in reducing the amount of effort people have to put in.
See also our profiles-in-modules conversation from earlier this year. I haven't forgotten this, and I will come back to it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the options hash pattern as inherently broken, for the reasons stated by @ripienaar.
I concur that not supporting a custom template is also a broken pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best combo is parameters for the most common options given for the application, with the ability to also define the content completely as a parameter. This gives the flexibility to allow low-touch usage of a module, but also allow drop-in replacement for the content from a given template, possibly in a module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arguments agains an options_hash for lack of validation I think are obsoleted by epp templates. Validation can be done there, fully exploiting Puppet type system.
I agree with @petems , my preference is towards a sane number of params to manage important or commonly used application specific settings + a parameter to set a custom template (and I suppose most people agree here) AND a parameter to populate a custom hash, in whatever desired way, so that settings used in (custom) templates can be defined as data (on hiera or wherever).
5378b7a
to
9f8be59
Compare
9f8be59
to
7c728d8
Compare
This finishes the move to a cleaner puppet4 interface. Since this is a breaking change, it also bumps the major version. Users of the previous version who were running without receiving any deprecation warnings can use this version without any changes.
7c728d8
to
77fbf3f
Compare
This PR contains a bunch of work to bring Puppet4 goodness to NTP. This is still depending on infrastructure work elsewhere(MODULES-3529, MODULES-3538), but the core improvements are in place.
Yes, some of the changes could be done in a single step, but I kept it split out for educational purposes, to make the process visible, and each step simple.