From e654b13a4d1147f4a06a9d896dff1b4ab0756ddf Mon Sep 17 00:00:00 2001 From: Amirhossein Shaerpour Date: Wed, 2 Apr 2025 22:32:39 +0330 Subject: [PATCH] chore: Use present/absent instead of attached/detached for server_volume module --- plugins/modules/server_volume.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/modules/server_volume.py b/plugins/modules/server_volume.py index db9de20..f6d39f7 100644 --- a/plugins/modules/server_volume.py +++ b/plugins/modules/server_volume.py @@ -39,8 +39,8 @@ options: - Attach to server - Detach from server type: str - default: attached - choices: [ attached, detached ] + default: present + choices: [ present, absent ] automount: description: - Automatically mount the volume to server. @@ -163,8 +163,8 @@ class AnsibleHCloudServerVolume(AnsibleHCloud): server={"type": "str", "required": True}, automount={"type": "bool", "default": False}, state={ - "choices": ["attached", "detached"], - "default": "attached", + "choices": ["present", "absent"], + "default": "present", }, **super().base_module_arguments(), ), @@ -179,9 +179,9 @@ def main(): hcloud = AnsibleHCloudServerVolume(module) state = module.params["state"] - if state == "attached": + if state == "present": hcloud.attach_volume() - elif state == "detached": + elif state == "absent": hcloud.detach_volume() module.exit_json(**hcloud.get_result())