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:
parent
f87c23629b
commit
044f600bae
3 changed files with 8 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue