1
0
Fork 0
mirror of https://github.com/ansible-collections/hetzner.hcloud.git synced 2026-02-04 08:01:49 +00:00

chore: Use present/absent instead of attached/detached for server_volume module

This commit is contained in:
Amirhossein Shaerpour 2025-04-02 22:32:39 +03:30 committed by shaerpour
parent e037525d0b
commit e654b13a4d
No known key found for this signature in database
GPG key ID: D89285D72B39ED8F

View file

@ -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())