mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #5972/094dc6b6 backport][stable-6] cloudflare_dns: Fix setting SRV records with a root level entry (#6097)
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 (cherry picked from commit094dc6b69c
) Co-authored-by: Roy Lenferink <lenferinkroy@gmail.com>
This commit is contained in:
parent
bc64c4035e
commit
31eddc0ffe
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'],
|
||||
"weight": params['weight'],
|
||||
"priority": params['priority'],
|
||||
"name": params['record'][:-len('.' + params['zone'])],
|
||||
"name": params['record'],
|
||||
"proto": params['proto'],
|
||||
"service": params['service']
|
||||
}
|
||||
|
||||
new_record = {"type": params['type'], "ttl": params['ttl'], 'data': srv_data}
|
||||
search_value = str(params['weight']) + '\t' + str(params['port']) + '\t' + params['value']
|
||||
search_record = params['service'] + '.' + params['proto'] + '.' + params['record']
|
||||
|
|
Loading…
Reference in a new issue