Browse files

updated the delete to use the ip posted to the data bag to delete the…

… old ip address from the dynect zone
  • Loading branch information...
1 parent 8f17fcb commit 834c9be240219f8f1f117c81c9cbf5a6eed51068 Kevin Gray committed Oct 29, 2010
Showing with 10 additions and 3 deletions.
  1. +10 −3 cookbooks/dynect/recipes/del_a_record.rb
View
13 cookbooks/dynect/recipes/del_a_record.rb
@@ -17,18 +17,25 @@
# limitations under the License.
#
+require 'rubygems'
include_recipe 'dynect'
+# Load the keys of the items in the data bag
+ips = data_bag('dynect_delete')
+
+ip = ips[0].gsub("a", ".")
+#puts ip
+
dynect_rr node[:hostname] do
customer node[:dynect][:customer]
username node[:dynect][:username]
password node[:dynect][:password]
zone node[:dynect][:zone]
record_type "A"
- #rdata({ "address" => node[:ipaddress] })
- rdata({ "address" => "10.10.1.1" }) # EC2 address that faile (elastic ips)
- fqdn "#{node[:dynect][:fqdn]}" # reserve.dyntini.com
+ rdata({ "address" => ip }) # EC2 address that faile (elastic ips)
+ #fqdn "#{node[:dynect][:fqdn]}" # reserve.dyntini.com
+ fqdn node[:dynect][:fqdn]
action :delete
end

0 comments on commit 834c9be

Please sign in to comment.