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 Sep 30, 2024
1 parent a7d1b0f commit ff813c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 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).
12 changes: 7 additions & 5 deletions plugins/modules/cloudflare_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,13 +715,15 @@ def ensure_dns_record(self, **kwargs):
"target": params['value'],
"port": params['port'],
"weight": params['weight'],
"priority": params['priority'],
"name": params['record'],
"proto": params['proto'],
"service": params['service']
"priority": params['priority']
}

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 ff813c0

Please sign in to comment.