Skip to content

Commit

Permalink
ntp v1.0.1, use attribute for service name
Browse files Browse the repository at this point in the history
* Support scientific linux
* Use service name attribute in resource (fixes EL derivatives)
  • Loading branch information
jtimberman committed Jul 18, 2011
1 parent 52d1341 commit 5c8cbac
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
8 changes: 8 additions & 0 deletions ntp/README.md
Expand Up @@ -3,6 +3,14 @@ DESCRIPTION


Installs and configures ntp, optionally set up a local NTP server. Installs and configures ntp, optionally set up a local NTP server.


CHANGES
=======

## v1.0.1:

* Support scientific linux
* Use service name attribute in resource (fixes EL derivatives)

REQUIREMENTS REQUIREMENTS
============ ============


Expand Down
2 changes: 1 addition & 1 deletion ntp/attributes/default.rb
@@ -1,7 +1,7 @@
case platform case platform
when "ubuntu","debian" when "ubuntu","debian"
default[:ntp][:service] = "ntp" default[:ntp][:service] = "ntp"
when "redhat","centos","fedora" when "redhat","centos","fedora","scientific"
default[:ntp][:service] = "ntpd" default[:ntp][:service] = "ntpd"
end end


Expand Down
4 changes: 2 additions & 2 deletions ntp/metadata.rb
Expand Up @@ -3,11 +3,11 @@
license "Apache 2.0" license "Apache 2.0"
description "Installs and configures ntp as a client or server" description "Installs and configures ntp as a client or server"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.0.0" version "1.0.1"


recipe "ntp", "Installs and configures ntp either as a server or client" recipe "ntp", "Installs and configures ntp either as a server or client"


%w{ ubuntu debian redhat centos fedora }.each do |os| %w{ ubuntu debian redhat centos fedora scientific }.each do |os|
supports os supports os
end end


Expand Down
11 changes: 6 additions & 5 deletions ntp/recipes/default.rb
Expand Up @@ -28,14 +28,15 @@
action :install action :install
end end


service node[:ntp][:service] do
action :start
end

template "/etc/ntp.conf" do template "/etc/ntp.conf" do
source "ntp.conf.erb" source "ntp.conf.erb"
owner "root" owner "root"
group "root" group "root"
mode 0644 mode 0644
notifies :restart, resources(:service => node[:ntp][:service]) notifies :restart, "service[ntp]"
end

service "ntp" do
service_name node[:ntp][:service]
action [:enable, :start]
end end

0 comments on commit 5c8cbac

Please sign in to comment.