class Bixby::Provision::NTP

Constants

DEFAULT_NTP_POOL
EXPORTS

Public Class Methods

new(*args) click to toggle source
Calls superclass method Bixby::Provision::Base::new
# File lib/bixby/provision/dsl/ntp.rb, line 11
def initialize(*args)
  super
  @service = if ubuntu? then
      "ntp"
    elsif centos? or amazon? then
      "ntpd"
    end
end

Public Instance Methods

set(server=DEFAULT_NTP_POOL) click to toggle source
# File lib/bixby/provision/dsl/ntp.rb, line 20
def set(server=DEFAULT_NTP_POOL)
  logger.info "ntp.set using #{server}"
  sys.package "ntpdate"
  stop
  logged_sudo("ntpdate #{server}", :env => { "PATH" => PATH } )
  start
end
start() click to toggle source
# File lib/bixby/provision/dsl/ntp.rb, line 28
def start
  service.start @service
end
stop() click to toggle source
# File lib/bixby/provision/dsl/ntp.rb, line 32
def stop
  service.stop @service
end