mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
chore: comment
This commit is contained in:
parent
0753da505d
commit
d14a08dbcc
2 changed files with 4 additions and 0 deletions
|
|
@ -192,6 +192,8 @@ class AnsibleHCloudLoadBalancerNetwork(AnsibleHCloud):
|
|||
if ip_range is not None:
|
||||
ip_range_network = ip_network(ip_range)
|
||||
if ip_range_network not in [ip_network(o.ip_range) for o in self.hcloud_network.subnets]:
|
||||
# Validate before "detach" instead of relying on the "attach" API
|
||||
# validation, leaving the resource in a half applied state.
|
||||
self.module.fail_json(msg=f"ip_range '{ip_range}' was not found in the network subnets")
|
||||
|
||||
if ip_address(self.hcloud_load_balancer_network.ip) not in ip_range_network:
|
||||
|
|
|
|||
|
|
@ -206,6 +206,8 @@ class AnsibleHCloudServerNetwork(AnsibleHCloud):
|
|||
if ip_range is not None:
|
||||
ip_range_network = ip_network(ip_range)
|
||||
if ip_range_network not in [ip_network(o.ip_range) for o in self.hcloud_network.subnets]:
|
||||
# Validate before "detach" instead of relying on the "attach" API
|
||||
# validation, leaving the resource in a half applied state.
|
||||
self.module.fail_json(msg=f"ip_range '{ip_range}' was not found in the network subnets")
|
||||
|
||||
if ip_address(self.hcloud_server_network.ip) not in ip_range_network:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue