From fb00485c95502de27e89046ea6b377b843fee4a8 Mon Sep 17 00:00:00 2001 From: Simon Marsh Date: Sun, 20 Sep 2020 15:27:24 +0100 Subject: [PATCH] basic structure --- .drone.yml | 29 +++++++++++++++++++++++++++++ creds.json | 7 +++++++ dnsconfig.js | 23 +++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .drone.yml create mode 100644 creds.json create mode 100644 dnsconfig.js diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..b257237 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,29 @@ +--- +kind: pipeline +type: docker +name: dnscontrol + +trigger: + event: push + +workspace: + path: /dns + +steps: + - name: preview + image: stackexchange/dnscontrol + environment: + PDNS_API_KEY: + from_secret: PDNS_API_KEY + commands: + - dnscontrol preview + + - name: push + image: stackexchange/dnscontrol + environment: + PDNS_API_KEY: + from_secret: PDNS_API_KEY + commands: + - dnscontrol push + when: + branch: master diff --git a/creds.json b/creds.json new file mode 100644 index 0000000..78a7937 --- /dev/null +++ b/creds.json @@ -0,0 +1,7 @@ +{ + "powerdns": { + "apiurl": "http://dns-burble.tier2.uk-lon1.burble.dn42:8081/api/v1", + "apikey": "$PDNS_API_KEY", + "servername": "localhost", + } +} diff --git a/dnsconfig.js b/dnsconfig.js new file mode 100644 index 0000000..0b8d817 --- /dev/null +++ b/dnsconfig.js @@ -0,0 +1,23 @@ +////////////////////////////////////////////////////////////////////////// +// providers section + +var REG_NONE = NewRegistrar('none', 'NONE'); +var PDNS = NewDnsProvider( + 'powerdns', + 'PowerDNS', + { + 'dnssec_on_create': true + } +); + +////////////////////////////////////////////////////////////////////////// + +D( + 'example.local', + REG_NONE, + DnsProvider(PDNS), + A('@', '1.2.3.4') +); + +////////////////////////////////////////////////////////////////////////// +// end of file