-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Summary
I'm keeping this as a feature, but it's arguably a bug. The volume handling modules both have name as a required parameter, but it is not actually unique at Scaleway, so it cannot be reliably used to manipulate volumes and could have some bad effects (for example, you might delete more than one volume with a state: absent task).
I propose to make id required and name optional, which would also allow renaming volumes with the module, currently only possible with the API directly due to this implementation.
The issue here is it will break backward compatibility, I don't know how folks feel about that. But as it is, it's potentially dangerous and not especially useful. It's basically impossible to pick out the volume attached to a specific instance without using ID, for example.
Issue Type
Feature Idea
Component Name
scaleway_volume, scaleway_volume_info
Additional Information
- name: Create 10GB volume
community.general.scaleway_volume:
name: my-volume # this can be optional, because Scaleway create a random name if you leave it empty
state: present
region: par1
project: "{{ scw_org }}"
size: 10000000000
volume_type: l_ssd
register: server_creation_check_task
- name: Rename and resize a volume
community.general.scaleway_volume:
id: 671d0ae1-631b-4447-b5e9-3e9d0aea7fc7
name: new-volume-name
size: 20000000000
state: present
region: par1
register: volume_update_check_task
- name: Make sure volume deleted
community.general.scaleway_volume:
id: 671d0ae1-631b-4447-b5e9-3e9d0aea7fc7
state: absent
region: par1Compare to actual examples here:
Code of Conduct
- I agree to follow the Ansible Code of Conduct