Skip to content

Commit

Permalink
remove us-centric pool servers for ntp
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Feb 17, 2011
1 parent d453eba commit 94252da
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 104 deletions.
37 changes: 24 additions & 13 deletions ntp/README.md
Expand Up @@ -3,30 +3,41 @@ DESCRIPTION

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

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

Should work on any Red Hat-family or Debian-family Linux distribution.

USAGE
=====

Set up the ntp attributes in a role. For example in a base.rb role applied to all nodes:

"ntp" => {
"servers" => "time.int.example.org"
}

Then in an ntpserver.rb role that is applied to NTP servers:

"ntp" => {
"is_server" => "true",
"servers" => "0.us.pool.ntp.org"
}

The time.int.example.org used in the base role is a CNAME for the NTP server.
name "base"
description "Role applied to all systems"
default_attributes(
"ntp" => {
"servers" => ["time.int.example.org"]
}
)

Then in an ntpserver.rb role that is applied to NTP servers (e.g., time.int.example.org):

name "ntp_server"
description "Role applied to the system that should be an NTP server."
default_attributes(
"ntp" => {
"is_server" => "true",
"servers" => ["0.pool.ntp.org", "1.pool.ntp.org"]
}
)

LICENSE AND AUTHOR
==================

Author:: Joshua Timberman (<joshua@opscode.com>)

Copyright 2009, Opscode, Inc.
Copyright 2009-2011, Opscode, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion ntp/attributes/default.rb
Expand Up @@ -6,4 +6,4 @@
end

default[:ntp][:is_server] = false
default[:ntp][:servers] = ["0.us.pool.ntp.org", "1.us.pool.ntp.org"]
default[:ntp][:servers] = ["0.pool.ntp.org", "1.pool.ntp.org"]
168 changes: 84 additions & 84 deletions ntp/metadata.json
@@ -1,103 +1,103 @@
{
"providing": {
},
"attributes": {
"ntp/servers": {
"required": "optional",
"calculated": false,
"choice": [

],
"default": [
"0.us.pool.ntp.org",
"1.us.pool.ntp.org"
],
"type": "array",
"recipes": [
"name": "ntp",
"description": "Installs and configures ntp as a client or server",
"long_description": "DESCRIPTION\n===========\n\nInstalls and configures ntp, optionally set up a local NTP server.\n\nREQUIREMENTS\n============\n\nShould work on any Red Hat-family or Debian-family Linux distribution.\n\nUSAGE\n=====\n\nSet up the ntp attributes in a role. For example in a base.rb role applied to all nodes:\n\n name \"base\"\n description \"Role applied to all systems\"\n default_attributes(\n \"ntp\" => {\n \"servers\" => [\"time.int.example.org\"]\n }\n )\n\nThen in an ntpserver.rb role that is applied to NTP servers (e.g., time.int.example.org):\n\n name \"ntp_server\"\n description \"Role applied to the system that should be an NTP server.\"\n default_attributes(\n \"ntp\" => {\n \"is_server\" => \"true\",\n \"servers\" => [\"0.pool.ntp.org\", \"1.pool.ntp.org\"]\n }\n )\n\nLICENSE AND AUTHOR\n==================\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\n\nCopyright 2009-2011, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"maintainer": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
"platforms": {
"ubuntu": [

],
"description": "Array of servers we should talk to",
"display_name": "NTP Servers"
},
"ntp/service": {
"required": "optional",
"calculated": false,
"choice": [
],
"debian": [

],
"default": "ntp",
"type": "string",
"recipes": [
],
"redhat": [

],
"description": "Name of the NTP service",
"display_name": "NTP Service"
},
"ntp/is_server": {
"required": "optional",
"calculated": false,
"choice": [
],
"centos": [

],
"default": "false",
"type": "string",
"recipes": [
],
"fedora": [

],
"description": "Set to true if this is an NTP server",
"display_name": "NTP Is Server?"
},
"ntp": {
"required": "optional",
"calculated": false,
"choice": [
]
},
"dependencies": {
},
"recommendations": {
},
"suggestions": {
},
"conflicting": {
},
"providing": {
},
"replacing": {
},
"attributes": {
"ntp": {
"display_name": "NTP",
"description": "Hash of NTP attributes",
"type": "hash",
"choice": [

],
"type": "hash",
"recipes": [
],
"calculated": false,
"required": "optional",
"recipes": [

],
"description": "Hash of NTP attributes",
"display_name": "NTP"
}
},
"replacing": {
},
"dependencies": {
},
"groupings": {
},
"recommendations": {
]
},
"platforms": {
"debian": [
"ntp/service": {
"display_name": "NTP Service",
"description": "Name of the NTP service",
"default": "ntp",
"choice": [

],
"fedora": [
"calculated": false,
"type": "string",
"required": "optional",
"recipes": [

]
},
"ntp/is_server": {
"display_name": "NTP Is Server?",
"description": "Set to true if this is an NTP server",
"default": "false",
"choice": [

],
"centos": [
"calculated": false,
"type": "string",
"required": "optional",
"recipes": [

]
},
"ntp/servers": {
"display_name": "NTP Servers",
"description": "Array of servers we should talk to",
"type": "array",
"default": [
"0.pool.ntp.org",
"1.pool.ntp.org"
],
"ubuntu": [
"choice": [

],
"redhat": [
"calculated": false,
"required": "optional",
"recipes": [

]
},
"license": "Apache 2.0",
"version": "0.8.2",
"maintainer": "Opscode, Inc.",
"suggestions": {
},
"recipes": {
"ntp": "Installs and configures ntp either as a server or client"
},
"maintainer_email": "cookbooks@opscode.com",
"name": "ntp",
"conflicting": {
},
"description": "Installs and configures ntp as a client or server",
"long_description": "DESCRIPTION\n===========\n\nInstalls and configures ntp, optionally set up a local NTP server.\n\nUSAGE\n=====\n\nSet up the ntp attributes in a role. For example in a base.rb role applied to all nodes:\n\n \"ntp\" => {\n \"servers\" => \"time.int.example.org\"\n }\n\nThen in an ntpserver.rb role that is applied to NTP servers:\n\n \"ntp\" => {\n \"is_server\" => \"true\",\n \"servers\" => \"0.us.pool.ntp.org\"\n }\n\nThe time.int.example.org used in the base role is a CNAME for the NTP server.\n\nLICENSE AND AUTHOR\n==================\n\nAuthor:: Joshua Timberman (<joshua@opscode.com>)\n\nCopyright 2009, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
}
}
},
"groupings": {
},
"recipes": {
"ntp": "Installs and configures ntp either as a server or client"
},
"version": "1.0.0"
}
4 changes: 2 additions & 2 deletions ntp/metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs and configures ntp as a client or server"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.8.2"
version "1.0.0"

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

Expand All @@ -30,5 +30,5 @@
:display_name => "NTP Servers",
:description => "Array of servers we should talk to",
:type => "array",
:default => ["0.us.pool.ntp.org", "1.us.pool.ntp.org"]
:default => ["0.pool.ntp.org", "1.pool.ntp.org"]

8 changes: 4 additions & 4 deletions ntp/templates/default/ntp.conf.erb
Expand Up @@ -7,10 +7,10 @@ filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

<% if node[:ntp][:is_server] -%>
server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 3.us.pool.ntp.org
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
<% else -%>
<% node[:ntp][:servers].each do |ntpserver| -%>
server <%= ntpserver %>
Expand Down

0 comments on commit 94252da

Please sign in to comment.