felixfontein.hosttech_dns.hosttech_dns_record – Add or delete entries in Hosttech DNS service¶
Note
This plugin is part of the felixfontein.hosttech_dns collection (version 1.2.0).
To install it use: ansible-galaxy collection install felixfontein.hosttech_dns
.
To use it in a playbook, specify: felixfontein.hosttech_dns.hosttech_dns_record
.
New in version 1.0.0: of felixfontein.hosttech_dns
Synopsis¶
Creates and deletes DNS records in Hosttech DNS service https://ns1.hosttech.eu/public/api?wsdl.
Parameters¶
Examples¶
- name: Add new.foo.com as an A record with 3 IPs
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: new.foo.com
type: A
ttl: 7200
value: 1.1.1.1,2.2.2.2,3.3.3.3
hosttech_username: foo
hosttech_password: bar
- name: Update new.foo.com as an A record with a list of 3 IPs
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: new.foo.com
type: A
ttl: 7200
value:
- 1.1.1.1
- 2.2.2.2
- 3.3.3.3
hosttech_username: foo
hosttech_password: bar
- name: Retrieve the details for new.foo.com
felixfontein.hosttech_dns.hosttech_dns_record_info:
zone: foo.com
record: new.foo.com
type: A
hosttech_username: foo
hosttech_password: bar
register: rec
- name: Delete new.foo.com A record using the results from the facts retrieval command
felixfontein.hosttech_dns.hosttech_dns_record:
state: absent
zone: foo.com
record: "{{ rec.set.record }}"
ttl: "{{ rec.set.ttl }}"
type: "{{ rec.set.type }}"
value: "{{ rec.set.value }}"
hosttech_username: foo
hosttech_password: bar
- name: Add an AAAA record
# Note that because there are colons in the value that the IPv6 address must be quoted!
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: localhost.foo.com
type: AAAA
ttl: 7200
value: "::1"
hosttech_username: foo
hosttech_password: bar
- name: Add a TXT record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: localhost.foo.com
type: TXT
ttl: 7200
value: 'bar'
hosttech_username: foo
hosttech_password: bar
- name: Remove the TXT record
felixfontein.hosttech_dns.hosttech_dns_record:
state: absent
zone: foo.com
record: localhost.foo.com
type: TXT
ttl: 7200
value: 'bar'
hosttech_username: foo
hosttech_password: bar
- name: Add a CAA record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: foo.com
type: CAA
ttl: 3600
value:
- "128 issue letsencrypt.org"
- "128 iodef mailto:webmaster@foo.com"
hosttech_username: foo
hosttech_password: bar
- name: Add an MX record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: foo.com
type: MX
ttl: 3600
value:
- "10 mail.foo.com"
hosttech_username: foo
hosttech_password: bar
- name: Add a CNAME record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: bla.foo.com
record: foo.com
type: CNAME
ttl: 3600
value:
- foo.foo.com
hosttech_username: foo
hosttech_password: bar
- name: Add a PTR record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.foo.com
record: foo.com
type: PTR
ttl: 3600
value:
- foo.foo.com
hosttech_username: foo
hosttech_password: bar
- name: Add an SPF record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: foo.com
type: SPF
ttl: 3600
value:
- "v=spf1 a mx ~all"
hosttech_username: foo
hosttech_password: bar
- name: Add a PTR record
felixfontein.hosttech_dns.hosttech_dns_record:
state: present
zone: foo.com
record: foo.com
type: PTR
ttl: 3600
value:
- "10 100 3333 service.foo.com"
hosttech_username: foo
hosttech_password: bar
Authors¶
Felix Fontein (@felixfontein)