Last active
December 21, 2015 21:19
-
-
Save ichilton/6367730 to your computer and use it in GitHub Desktop.
Add dns record on DNSimple with Chef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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