mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-13 12:21:12 +00:00
hcloud_volume attach step should be idempotent (#56906)
This commit is contained in:
committed by
René Moser
parent
8f89d1d3da
commit
7f08de6b6c
@@ -232,7 +232,7 @@ class AnsibleHcloudVolume(Hcloud):
|
||||
server_name = self.module.params.get("server")
|
||||
if server_name:
|
||||
server = self.client.servers.get_by_name(server_name)
|
||||
if self.hcloud_volume.server != server:
|
||||
if self.hcloud_volume.server is None or self.hcloud_volume.server.name != server.name:
|
||||
if not self.module.check_mode:
|
||||
automount = self.module.params.get("automount", False)
|
||||
self.hcloud_volume.attach(server, automount=automount).wait_until_finished()
|
||||
|
||||
Reference in New Issue
Block a user