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

fix: only update load balancer service when changed (#603)

##### SUMMARY

We only was to perform an update call when a value changed, or we end up
with an empty update request.
This commit is contained in:
Jonas L. 2025-02-24 14:26:58 +01:00 committed by GitHub
parent 4f8f95b58f
commit 6956596fd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -459,12 +459,12 @@ class AnsibleHCloudLoadBalancerService(AnsibleHCloud):
)
changed = True
if not self.module.check_mode:
if changed and not self.module.check_mode:
action = self.hcloud_load_balancer.update_service(LoadBalancerService(**params))
action.wait_until_finished()
self._get_load_balancer()
except HCloudException as exception:
self.fail_json_hcloud(exception)
self._get_load_balancer()
if changed:
self._mark_as_changed()