mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
hcloud_server: Improve Error Message when attaching a not existing firewall (#96)
This commit is contained in:
parent
f4b336a444
commit
ffd998a0d6
3 changed files with 18 additions and 0 deletions
|
|
@ -476,6 +476,8 @@ class AnsibleHcloudServer(Hcloud):
|
|||
self._mark_as_changed()
|
||||
if not self.module.check_mode:
|
||||
fw = self.client.firewalls.get_by_name(fname)
|
||||
if fw is None:
|
||||
self.module.fail_json(msg="firewall %s was not found" % fname)
|
||||
r = FirewallResource(type="server", server=self.hcloud_server)
|
||||
actions = self.client.firewalls.apply_to_resources(fw, [r])
|
||||
for a in actions:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue