/nkadel-chef-hosts

Chef /etc/hosts template based cookbook

Primary LanguageRubyOtherNOASSERTION

hosts Cookbook

Configure /etc/hosts from template

Requirements

packages

None required

Attributes

e.g.

hosts::default

Key Type Description Default
['hosts']['file'] string location of published file /etc/hosts
['hosts']['owner'] string owner of hosts file root
['hosts']['group'] string group of hosts file root
['hosts']['mode'] string mode of hosts file 0644
['hosts']['fqdn'] strung FQDN of client, defaults to chef detected true
['hosts']['fqdn_as_loopback'] boolean use FQDN in loopback entry true
['hosts']['fqdn_as_ipaddress'] boolean Use FQDN with chef ['hosts']['ipaddress'] false

Usage

hosts::default

Set attributes in roles or environments as needed.

e.g. Include hosts in your node's run_list with relevant atttributes:

{
  "name":"my_node",
    "hosts": {
      "entries": {
	"127.0.0.2": "localhost2.localdoman # test for hosts cookbook",
	"www.xxx.yyy.zzz": "foo.example.com foo"
      }
    }
  "run_list": [
    "recipe[hosts]"
  ]
}

License and Authors

License: Apache v2.0 Authors: Nico Kadel-Garcia nkadel@skyhookwireless.com