mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-10 11:11:29 -07:00
hcloud_volume attach step should be idempotent (#56906)
This commit is contained in:
parent
8f89d1d3da
commit
7f08de6b6c
3 changed files with 16 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue