Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

hosts cookbook added

  • Loading branch information...
commit 7c932e69d0462665e5611e428007531f122c8f7f 1 parent 99f459f
Marius Ducea authored September 03, 2010
8  hosts/README.rdoc
Source Rendered
... ...
@@ -0,0 +1,8 @@
  1
+= DESCRIPTION:
  2
+
  3
+= REQUIREMENTS:
  4
+
  5
+= ATTRIBUTES: 
  6
+
  7
+= USAGE:
  8
+
29  hosts/metadata.json
... ...
@@ -0,0 +1,29 @@
  1
+{
  2
+    "recipes": {
  3
+    },
  4
+    "replacing": {
  5
+    },
  6
+    "attributes": {
  7
+    },
  8
+    "maintainer_email": "marius@promethost.com",
  9
+    "groupings": {
  10
+    },
  11
+    "dependencies": {
  12
+    },
  13
+    "recommendations": {
  14
+    },
  15
+    "long_description": "= DESCRIPTION:\n\n= REQUIREMENTS:\n\n= ATTRIBUTES: \n\n= USAGE:\n\n",
  16
+    "suggestions": {
  17
+    },
  18
+    "platforms": {
  19
+    },
  20
+    "license": "Apache 2.0",
  21
+    "version": "0.1.0",
  22
+    "conflicting": {
  23
+    },
  24
+    "name": "hosts",
  25
+    "providing": {
  26
+    },
  27
+    "description": "Configures /etc/hosts",
  28
+    "maintainer": "Promet Solutions"
  29
+  }
7  hosts/metadata.rb
... ...
@@ -0,0 +1,7 @@
  1
+maintainer       "Promet Solutions"
  2
+maintainer_email "marius@promethost.com"
  3
+license          "Apache 2.0"
  4
+description      "Configures /etc/hosts"
  5
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
  6
+version          "0.1"
  7
+
26  hosts/recipes/default.rb
... ...
@@ -0,0 +1,26 @@
  1
+#
  2
+# Author:: Marius Ducea (marius@promethost.com)
  3
+# Cookbook Name:: hosts
  4
+# Recipe:: default
  5
+#
  6
+# Copyright 2010, Promet Solutions
  7
+#
  8
+# Licensed under the Apache License, Version 2.0 (the "License");
  9
+# you may not use this file except in compliance with the License.
  10
+# You may obtain a copy of the License at
  11
+# 
  12
+#     http://www.apache.org/licenses/LICENSE-2.0
  13
+# 
  14
+# Unless required by applicable law or agreed to in writing, software
  15
+# distributed under the License is distributed on an "AS IS" BASIS,
  16
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17
+# See the License for the specific language governing permissions and
  18
+# limitations under the License.
  19
+#
  20
+
  21
+template "/etc/hosts" do
  22
+  source "hosts.erb"
  23
+  owner "root"
  24
+  group "root"
  25
+  mode 0644
  26
+end
15  hosts/templates/default/hosts.erb
... ...
@@ -0,0 +1,15 @@
  1
+127.0.0.1	<%= node['fqdn'] %> <%= node['hostname'] %>	localhost localhost.localdomain
  2
+
  3
+<% if node[:hosts] %>
  4
+<% node[:hosts].sort.each do |ip, dns| %>
  5
+<%= ip %>	<%= dns %>
  6
+<% end %>
  7
+<% end %>
  8
+
  9
+# The following lines are desirable for IPv6 capable hosts
  10
+::1 ip6-localhost ip6-loopback
  11
+fe00::0 ip6-localnet
  12
+ff00::0 ip6-mcastprefix
  13
+ff02::1 ip6-allnodes
  14
+ff02::2 ip6-allrouters
  15
+ff02::3 ip6-allhosts

0 notes on commit 7c932e6

Please sign in to comment.
Something went wrong with that request. Please try again.