1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

fix: dns records order is not guaranteed

This commit is contained in:
jo 2025-11-13 15:33:20 +01:00
parent f87c23629b
commit 044f600bae
No known key found for this signature in database
GPG key ID: B2FEC9B22722B984
3 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- zone_rrset - Records order is not guaranteed, the module will not generate a diff if the order of records changes.

View file

@ -321,6 +321,9 @@ class AnsibleHCloudZoneRRSet(AnsibleHCloud):
current = [self._prepare_result_record(o) for o in self.hcloud_zone_rrset.records]
wanted = [self._prepare_result_record(ZoneRecord.from_dict(o)) for o in self.module.params.get("records")]
current = sorted(current, key=lambda x: x["value"])
wanted = sorted(wanted, key=lambda x: x["value"])
return current != wanted
def present(self):

View file

@ -123,10 +123,11 @@
key: changed
new: value
records:
- value: 201.118.10.11
comment: web server 1
# Order is not guaranteed, should still be idempotent
- value: 201.118.10.13
comment: web server 3
- value: 201.118.10.11
comment: web server 1
change_protection: true
register: result
- name: Verify update idempotency