|
| 1 | +DESCRIPTION |
| 2 | +=========== |
| 3 | + |
| 4 | +Automatically configures system DNS using Dyn's API. |
| 5 | + |
| 6 | +REQUIREMENTS |
| 7 | +============ |
| 8 | + |
| 9 | +Chef 0.8+. |
| 10 | + |
| 11 | +A Dynect account. |
| 12 | + |
| 13 | +The `dynect_rest` gem. The `dynect::default` recipe installs this gem from gemcutter. |
| 14 | + |
| 15 | +Works on any platform Chef runs on that can install gems from Rubygems.org. |
| 16 | + |
| 17 | +ATTRIBUTES |
| 18 | +========== |
| 19 | + |
| 20 | +The following attributes need to be set either in a role or on a node directly, they are not set at the cookbook level: |
| 21 | + |
| 22 | +* dynect.customer - Customer ID |
| 23 | +* dynect.username - Username |
| 24 | +* dynect.password - Password |
| 25 | +* dynect.zone - Zone |
| 26 | +* dynect.domain - Domain |
| 27 | + |
| 28 | +Example JSON: |
| 29 | + |
| 30 | +{ |
| 31 | + "dynect":{ |
| 32 | + "customer": "CUSTOMER", |
| 33 | + "username": "USERNAME", |
| 34 | + "password": "PASSWORD", |
| 35 | + "zone": "ZONE", |
| 36 | + "domain": "DOMAIN" |
| 37 | + } |
| 38 | +} |
| 39 | + |
| 40 | +EC2 specific attributes: |
| 41 | + |
| 42 | +* dynect.ec2.type - type of system, web, db, etc. Default is 'ec2'. |
| 43 | +* dynect.ec2.env - logical application environment the system is in. Default is 'prod'. |
| 44 | + |
| 45 | +RESOURCES |
| 46 | +========= |
| 47 | + |
| 48 | +rr |
| 49 | +-- |
| 50 | + |
| 51 | +DNS Resource Record. |
| 52 | + |
| 53 | +Actions: |
| 54 | + |
| 55 | +Applies to the DNS record being managed. |
| 56 | + |
| 57 | +*`:create` |
| 58 | +*`:replace` |
| 59 | +*`:update` |
| 60 | +*`:delete` |
| 61 | + |
| 62 | +Attribute Parameters: |
| 63 | + |
| 64 | +*`record_type` - DNS record type (CNAME, A, etc) |
| 65 | +*`rdata` - record data, see the Dyn API documentation. |
| 66 | +*`ttl` - time to live in seconds |
| 67 | +*`fqdn` - fully qualified domain name |
| 68 | +*`username` - dyn username |
| 69 | +*`password` - dyn password |
| 70 | +*`customer` - dyn customer id |
| 71 | +*`zone` - DNS zone |
| 72 | + |
| 73 | +None of the parameters have default values. |
| 74 | + |
| 75 | +Example: |
| 76 | + |
| 77 | +dynect_rr "webprod" do |
| 78 | + record_type "A" |
| 79 | + rdata({"address" => "10.1.1.10"}) |
| 80 | + fqdn "webprod.#{node.dynect.domain}" |
| 81 | + customer node[:dynect][:customer] |
| 82 | + username node[:dynect][:username] |
| 83 | + password node[:dynect][:password] |
| 84 | + zone node[:dynect][:zone] |
| 85 | +end |
| 86 | + |
| 87 | +RECIPES |
| 88 | +======= |
| 89 | + |
| 90 | +This cookbook provides the following recipes. |
| 91 | + |
| 92 | +default |
| 93 | +------- |
| 94 | + |
| 95 | +The default recipe installs Adam Jacob's `dynect_rest` gem during the Chef run's compile time to ensure it is available in the same run as utilizing the `dynect_rr` resource/provider. |
| 96 | + |
| 97 | +ec2 |
| 98 | +--- |
| 99 | + |
| 100 | +**Only use this recipe on Amazon AWS EC2 hosts!** |
| 101 | + |
| 102 | +The `dynect::ec2` recipe provides an example of working with the Dyn API with EC2 instances. It creates CNAME records based on the EC2 instance ID (`node.ec2.instance_id`), and a constructed hostname from the dynect.ec2 attributes. |
| 103 | + |
| 104 | +The recipe also edits resolv.conf to search compute-1.internal and the dynect.domain and use dynect.domain as the default domain, and it will set the nodes hostname per the DNS settings. |
| 105 | + |
| 106 | +a_record |
| 107 | +-------- |
| 108 | + |
| 109 | +The `dynect::a_record` recipe will create an `A` record for the node using the detected hostname and IP address from `ohai`. |
| 110 | + |
| 111 | +FURTHER READING |
| 112 | +=============== |
| 113 | + |
| 114 | +Information on the Dynect API: |
| 115 | + |
| 116 | +*[PDF](http://cdn.dyndns.com/pdf/Dynect-API.pdf) |
| 117 | + |
| 118 | +Dynect REST Ruby Library: |
| 119 | + |
| 120 | +*[Gem](http://rubygems.org/gems/dynect_rest) |
| 121 | +*[Code](http://github.com/adamhjk/dynect_rest) |
| 122 | + |
| 123 | +LICENSE AND AUTHOR |
| 124 | +================== |
| 125 | + |
| 126 | +- Author: Adam Jacob ( <[email protected]>) |
| 127 | +- Copyright: 2010, Opscode, Inc. |
| 128 | + |
| 129 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 130 | +you may not use this file except in compliance with the License. |
| 131 | +You may obtain a copy of the License at |
| 132 | + |
| 133 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 134 | + |
| 135 | +Unless required by applicable law or agreed to in writing, software |
| 136 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 137 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 138 | +See the License for the specific language governing permissions and |
| 139 | +limitations under the License. |
0 commit comments