mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
cloudflare_dns: Fix setting SRV records with a root level entry (#5972)
* cloudflare_dns: Fix setting SRV records with a root level entry
* cloudflare_dns: Remove the part which deletes the zone from the SRV record name
The cloudflare API accepts the record name + zone name to be sent. Removing that, will guarantee the module to be idempotent even though that line was added ~7 years ago for that specific reason: 7477fe5141
It seems the most logical explanition is that Cloudflare changed their API response somewhere over the last 7 years.
* cloudflare_dns: Update the changelog fragment
This commit is contained in:
parent
810f3b50fc
commit
094dc6b69c
2 changed files with 5 additions and 1 deletions
3
changelogs/fragments/5972-cloudflare-dns-srv-record.yml
Normal file
3
changelogs/fragments/5972-cloudflare-dns-srv-record.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
bugfixes:
|
||||||
|
- "cloudflare_dns - fixed the possiblity of setting a root-level SRV DNS record (https://github.com/ansible-collections/community.general/pull/5972)."
|
||||||
|
- "cloudflare_dns - fixed the idempotency for SRV DNS records (https://github.com/ansible-collections/community.general/pull/5972)."
|
|
@ -694,10 +694,11 @@ class CloudflareAPI(object):
|
||||||
"port": params['port'],
|
"port": params['port'],
|
||||||
"weight": params['weight'],
|
"weight": params['weight'],
|
||||||
"priority": params['priority'],
|
"priority": params['priority'],
|
||||||
"name": params['record'][:-len('.' + params['zone'])],
|
"name": params['record'],
|
||||||
"proto": params['proto'],
|
"proto": params['proto'],
|
||||||
"service": params['service']
|
"service": params['service']
|
||||||
}
|
}
|
||||||
|
|
||||||
new_record = {"type": params['type'], "ttl": params['ttl'], 'data': srv_data}
|
new_record = {"type": params['type'], "ttl": params['ttl'], 'data': srv_data}
|
||||||
search_value = str(params['weight']) + '\t' + str(params['port']) + '\t' + params['value']
|
search_value = str(params['weight']) + '\t' + str(params['port']) + '\t' + params['value']
|
||||||
search_record = params['service'] + '.' + params['proto'] + '.' + params['record']
|
search_record = params['service'] + '.' + params['proto'] + '.' + params['record']
|
||||||
|
|
Loading…
Reference in a new issue