mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
fix: Don't detach volume if no server defined
and volume already attached to another server
This commit is contained in:
parent
3c84f19ef5
commit
ed038a1116
1 changed files with 0 additions and 6 deletions
|
|
@ -244,12 +244,6 @@ class AnsibleHCloudVolume(AnsibleHCloud):
|
|||
action = self.hcloud_volume.attach(server, automount=automount)
|
||||
action.wait_until_finished()
|
||||
self._mark_as_changed()
|
||||
else:
|
||||
if self.hcloud_volume.server is not None:
|
||||
if not self.module.check_mode:
|
||||
action = self.hcloud_volume.detach()
|
||||
action.wait_until_finished()
|
||||
self._mark_as_changed()
|
||||
|
||||
labels = self.module.params.get("labels")
|
||||
if labels is not None and labels != self.hcloud_volume.labels:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue