diff --git a/plugins/modules/hcloud_floating_ip.py b/plugins/modules/hcloud_floating_ip.py index a08932e..a949670 100644 --- a/plugins/modules/hcloud_floating_ip.py +++ b/plugins/modules/hcloud_floating_ip.py @@ -259,7 +259,7 @@ class AnsibleHcloudFloatingIP(Hcloud): self._mark_as_changed() server = self.module.params.get("server") - if server is not None: + if server is not None and server != self.hcloud_floating_ip.server.name: if self.module.params.get("force") or self.hcloud_floating_ip.server is None: if not self.module.check_mode: self.hcloud_floating_ip.assign( @@ -267,7 +267,7 @@ class AnsibleHcloudFloatingIP(Hcloud): ) else: self.module.warn( - "Floating IP is already assigned to server %s. You need to unassign the Floating IP or use force=yes." + "Floating IP is already assigned to another server %s. You need to unassign the Floating IP or use force=yes." % self.hcloud_floating_ip.server.name ) self._mark_as_changed()