From: Tom Hughes Date: Fri, 7 Feb 2020 15:39:00 +0000 (+0000) Subject: Install dnscontrol and API credentials on DNS management server X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/b53cbecada759e3169a483989fc50d9e2a5c25c0 Install dnscontrol and API credentials on DNS management server --- diff --git a/cookbooks/dns/recipes/default.rb b/cookbooks/dns/recipes/default.rb index 1896e99b8..ac404488b 100644 --- a/cookbooks/dns/recipes/default.rb +++ b/cookbooks/dns/recipes/default.rb @@ -36,6 +36,14 @@ package %w[ libjson-xs-perl ] +remote_file "/usr/local/bin/dnscontrol" do + action :create + source "https://github.com/StackExchange/dnscontrol/releases/download/v2.10.0/dnscontrol-Linux" + owner "root" + group "root" + mode 0o755 +end + directory "/srv/dns.openstreetmap.org" do owner "root" group "root" @@ -109,6 +117,14 @@ directory "/var/lib/dns" do notifies :run, "execute[dns-update]" end +template "/var/lib/dns/creds.json" do + source "creds.json.erb" + owner "git" + group "git" + mode 0o440 + variables :passwords => passwords +end + cookbook_file "#{node[:dns][:repository]}/hooks/post-receive" do source "post-receive" owner "git" diff --git a/cookbooks/dns/templates/default/creds.json.erb b/cookbooks/dns/templates/default/creds.json.erb new file mode 100644 index 000000000..980c0fb38 --- /dev/null +++ b/cookbooks/dns/templates/default/creds.json.erb @@ -0,0 +1,11 @@ +{ + "gandi_v5": { + "apikey": "<%= @passwords["gandi"] %>", + "sharing_id": "7028b616-ba65-11e7-8343-00163ec31f40" + }, + "cloudflare": { + "accountid": "049c95aba02c95fc1e78a9d255282e0f", + "accountname": "OpenStreetMap", + "apitoken": "<%= @passwords["cloudflare"] %>" + } +}