Repository: ansible-collections/community.general

Issue:
Proxmox disk fails to create cdrom
### Summary

I am trying to create a cdrom (ide2) with the proxmox_disk module, and it fails with the following error:

`fatal: [proxnode]: FAILED! => {"changed": false, "msg": "Unable to create/update disk ide2 in VM 9002: 500 Internal Server Error: unable to parse directory volume name 'iso/ubuntu-22.04.2-desktop-amd64.iso:None'", "vmid": 9002}`

This appears to be the result of how [proxmox_kvm.py:508](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/proxmox_disk.py#LL508C17-L508C27) composes the config string.

The following patch seems to resolve this issue:
```patch
--- collections/ansible_collections/community/general/plugins/modules/proxmox_disk.py	2023-06-21 23:12:49.164301501 -0400
+++ collections/ansible_collections/community/general/plugins/modules/proxmox_disk.py	2023-06-21 22:48:51.643982049 -0400
@@ -505,7 +505,9 @@
                 timeout_str = "Reached timeout while importing VM disk. Last line in task before timeout: %s"
                 ok_str = "Disk %s imported into VM %s"
             else:
-                config_str = "%s:%s" % (self.module.params["storage"], self.module.params["size"])
+                config_str = self.module.params["storage"]
+                if self.module.params["media"] != "cdrom":
+                    config_str += ":%s" % (self.module.params["size"])
                 ok_str = "Disk %s created in VM %s"
                 timeout_str = "Reached timeout while creating VM disk. Last line in task before timeout: %s"
```

### Issue Type

Bug Report

### Component Name

proxmox_disk

### Ansible Version

```console (paste below)
$ ansible --version
ansible [core 2.15.0]
  config file = None
  configured module search path = ['/home/exodious/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/exodious/.local/pipx/venvs/ansible/lib/python3.10/site-packages/ansible
  ansible collection location = /home/exodious/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/exodious/.local/bin/ansible
  python version = 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] (/home/exodious/.local/pipx/venvs/ansible/bin/python)
  jinja version = 3.1.2
  libyaml = True
```


### Community.general Version

```console (paste below)
$ ansible-galaxy collection list community.general

# /home/exodious/.ansible/collections/ansible_collections
Collection        Version
----------------- -------
community.general 7.1.0  

# /home/exodious/.local/pipx/venvs/ansible/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 7.0.1
```


### Configuration

```console (paste below)
$ ansible-config dump --only-changed
CONFIG_FILE() = None
EDITOR(env: EDITOR) = nano
```


### OS / Environment

Running ansible from Pop!_OS 22.04
Proxmox 7.4-13

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml
- name: Add CDROM
  hosts: proxmox_api

  tasks:
    - name: Add CDROM
      community.general.proxmox_disk:
        api_host: "{{ inventory_hostname }}"
        api_user: "USERNAME"
        api_token_id: "TOKEN ID"
        api_token_secret: "TOKEN SECRET"
        vmid: 9002
        disk: ide2
        storage: local:iso/ubuntu-22.04.2-desktop-amd64.iso
        media: cdrom
        create: forced
        state: present
        validate_certs: false
```


### Expected Results

I expected a cdrom disk ide2 to be created

### Actual Results

```console
fatal: [proxnode]: FAILED! => {"changed": false, "msg": "Unable to create/update disk ide2 in VM 9002: 500 Internal Server Error: unable to parse directory volume name 'iso/ubuntu-22.04.2-desktop-amd64.iso:None'", "vmid": 9002}
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/proxmox_disk.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/proxmox_disk.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @Ajpantuso @Thulium-Drake @UnderGreen @castorsky @joshainglis @karmab @tleguern
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Thank you for reporting, @exodious. Your patch seems to be correct (it wont do harm at least :)). Could you please create a pull request to include patch?

Resolving patch:
diff --git a/plugins/modules/proxmox_disk.py b/plugins/modules/proxmox_disk.py
--- a/plugins/modules/proxmox_disk.py
+++ b/plugins/modules/proxmox_disk.py
@@ -505,7 +505,9 @@ def create_disk(self, disk, vmid, vm, vm_config):
                 timeout_str = "Reached timeout while importing VM disk. Last line in task before timeout: %s"
                 ok_str = "Disk %s imported into VM %s"
             else:
-                config_str = "%s:%s" % (self.module.params["storage"], self.module.params["size"])
+                config_str = self.module.params["storage"]
+                if self.module.params.get("media") != "cdrom":
+                    config_str += ":%s" % (self.module.params["size"])
                 ok_str = "Disk %s created in VM %s"
                 timeout_str = "Reached timeout while creating VM disk. Last line in task before timeout: %s"
 


Test patch: