Skip to content

Commit 55ca01c

Browse files
committed
Fixed fqdn module names
1 parent cc794cb commit 55ca01c

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

dyndns.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818

1919
tasks:
2020
- name: Assert that external IP Address is set
21-
assert:
22-
that: "{{ external_ip_address | length > 0}}"
23-
fail_msg: "It seems that you haven't provided an external IP Address."
24-
success_msg: "IP Address provided. Proceeding."
21+
ansible.builtin.assert:
22+
that: "{{ external_ip_address | length > 0 }}"
23+
fail_msg: "It seems that you haven't provided an external IP Address."
24+
success_msg: "IP Address provided. Proceeding."
2525

2626
- name: Get Zone ID for {{ dns_zone }}
27-
uri:
27+
ansible.builtin.uri:
2828
url: "https://dns.hetzner.com/api/v1/zones?name={{ dns_zone }}"
2929
method: GET
3030
headers:
3131
Auth-API-Token: "{{ api_key }}"
3232
register: zone_id
3333

3434
- name: Get all DNS Records for Zone {{ dns_zone }}
35-
uri:
35+
ansible.builtin.uri:
3636
url: "https://dns.hetzner.com/api/v1/records?zone_id={{ zone_id.json.zones[0].id }}"
3737
method: GET
3838
headers:

manage_record.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
loop: "{{ dns_records.json.records }}"
1616

1717
- name: Assert that the Record is from Type A
18-
assert:
18+
ansible.builtin.assert:
1919
that: dns_record_type == "A"
2020
fail_msg: "The DNS Record {{ dyndns_name }} already exist with a Record Type of {{ dns_record_type }}. Needs to be Type A. Please delete the Record manually and run the Playbook again."
2121
success_msg: "DNS Record Type is Type A as expected. Proceeding."
@@ -25,7 +25,7 @@
2525
# var: dns_record_id
2626

2727
- name: DYNDNS Record {{ dyndns_name }} does NOT exist, will create it with external IP as {{ external_ip_address }}
28-
uri:
28+
ansible.builtin.uri:
2929
url: "https://dns.hetzner.com/api/v1/records"
3030
method: POST
3131
headers:
@@ -39,7 +39,7 @@
3939
when: (dns_record_id | length == 0 and external_ip_address | length > 0)
4040

4141
- name: DYNDNS Record does exist, will update it with external IP as {{ external_ip_address }}
42-
uri:
42+
ansible.builtin.uri:
4343
url: "https://dns.hetzner.com/api/v1/records/{{ dns_record_id }}"
4444
method: PUT
4545
headers:
@@ -53,5 +53,6 @@
5353
when: (dns_record_id | length > 0 and external_ip_address | length > 0)
5454

5555
rescue:
56-
- debug:
56+
- name: There was an error
57+
debug:
5758
msg: "There was an Error DNS name {{ dyndns_name }} registration. Proceed with next entry!"

0 commit comments

Comments
 (0)