Skip to content

Instantly share code, notes, and snippets.

@ichilton
Last active December 21, 2015 21:19
Show Gist options
  • Save ichilton/6367730 to your computer and use it in GitHub Desktop.
Save ichilton/6367730 to your computer and use it in GitHub Desktop.
Add dns record on DNSimple with Chef
dnsimple_credentials = Chef::EncryptedDataBagItem.load("secrets", "dnsimple", Chef::EncryptedDataBagItem::DEFAULT_SECRET_FILE)
if dnsimple_credentials && dnsimple_credentials['domains'].include?(node[:domain])
include_recipe 'dnsimple'
dnsimple_record "#{node['hostname']}.#{node['domain']}" do
domain node['domain']
content node['ipaddress']
type "A"
action :create
username dnsimple_credentials['username']
password dnsimple_credentials['password']
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment