Skip to content

Instantly share code, notes, and snippets.

@dorkmatt
Created September 22, 2016 01:04
Show Gist options
  • Save dorkmatt/e728a6f50372d710186c2b75e3b10477 to your computer and use it in GitHub Desktop.
Save dorkmatt/e728a6f50372d710186c2b75e3b10477 to your computer and use it in GitHub Desktop.
Ansible DNSMadeEasy example
---
- name: "DNSMadeEasy example"
hosts: localhost
vars:
dnsmadeeasy_api_key: "YOUR API KEY" # https://cp.dnsmadeeasy.com/account/info
dnsmadeeasy_api_secret: "YOUR API SECRET"
dns_entries:
- { record_name: '10', record_type: 'PTR', record_value: 'xe-2-0-1.sfo01.example.net.', domain: '2.0.192.in-addr.arpa' }
- { record_name: 'xe-2-0-1.sfo01', record_type: 'A', record_value: '192.0.2.10', domain: 'example.net' }
tasks:
- name: fetch dnsmadeeasy records for domain by ID
dnsmadeeasy:
account_key: "{{ dnsmadeeasy_api_key }}"
account_secret: "{{ dnsmadeeasy_api_secret }}"
domain: "{{ item.domain }}"
record_name: "{{ item.record_name }}"
record_type: "{{ item.record_type }}"
record_value: "{{ item.record_value }}"
record_ttl: 86400
state: present
register: response
with_items: "{{ dns_entries }}"
- debug: msg="{{ response }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment