Skip to content

Commit

Permalink
cloudflare_dns: Update SRV record handling for Cloudflare API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Oct 1, 2024
1 parent a7d1b0f commit 6bdf328
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8679-fix-cloudflare-srv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- - cloudflare_dns - fix changing Cloudflare SRV records (https://github.com/ansible-collections/community.general/issues/8679, https://github.com/ansible-collections/community.general/pull/8948).
10 changes: 6 additions & 4 deletions plugins/modules/cloudflare_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,14 @@ def ensure_dns_record(self, **kwargs):
"port": params['port'],
"weight": params['weight'],
"priority": params['priority'],
"name": params['record'],
"proto": params['proto'],
"service": params['service']
}

new_record = {"type": params['type'], "ttl": params['ttl'], 'data': srv_data}
new_record = {
"type": params['type'],
"name": params['service'] + '.' + params['proto'] + '.' + params['record'],
"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']

Expand Down

0 comments on commit 6bdf328

Please sign in to comment.