Please review pull request #135: (maint) No longer default to running ntp opened by (djm68)
Description:
Back porting useful mod from the 2.0.x harness series.
NTP no longer runs bby default, and option to define any
NTP server.
- Opened: Thu Feb 09 00:31:37 UTC 2012
- Based on: puppetlabs:pe1.2.x (ba3dadd28c2ecbae4bc6c9b54a37c9b217ec25a7)
- Requested merge: djm68:no_default_ntp_step (62b29a42d56483a166fb71291da4fe104449521f)
Diff follows:
diff --git a/lib/options_parsing.rb b/lib/options_parsing.rb
index 3e21657..68c6a52 100644
--- a/lib/options_parsing.rb
+++ b/lib/options_parsing.rb
@@ -106,9 +106,14 @@ def self.parse_args
@options[:mrpropper] = TRUE
end
- @options[:notimesync] = FALSE
- opts.on( '--no-ntp', 'skip ntpdate step' ) do
- @options[:notimesync] = TRUE
+ @options[:ntpserver] = 'ntp.puppetlabs.lan'
+ opts.on( '--ntp-server host', 'NTP server name' ) do |server|
+ @options[:ntpserver] = server
+ end
+
+ @options[:timesync] = FALSE
+ opts.on( '--ntp', 'run ntpdate step' ) do
+ @options[:timesync] = TRUE
end
@options[:stdout_only] = false
diff --git a/setup/early/03-ntpdate.rb b/setup/early/03-ntpdate.rb
index 105c54a..d70c572 100644
--- a/setup/early/03-ntpdate.rb
+++ b/setup/early/03-ntpdate.rb
@@ -1,11 +1,11 @@
-unless options[:notimesync]
+if options[:timesync]
test_name "Update system time sync"
step "run ntpdate against NTP pool systems"
hosts.each do |host|
if host['platform'].include? 'solaris'
- on(host, "sleep 10 && ntpdate -w us.pool.ntp.org")
+ on(host, "sleep 10 && ntpdate -w #{options[:ntpserver]}")
else
- on(host, "ntpdate -t 5 us.pool.ntp.org")
+ on(host, "ntpdate -t 5 #{options[:ntpserver]}")
end
end
else
-- You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
