Description
Summary
In PVE 7.4 or PVE8, when setting a tag for a VM or a container, i get the following error if the tag contains any uppercase characters (ie. Debian
or OpenBSD
) :
failed: [127.0.0.1] (item=myVM) => {"ansible_loop_var": "item", "changed": false, "item": "myVM", "msg": "Debian is not a valid tag"}
Setting the same tag in lowercase (ie. debian
or freebsd
) works without any issue.
The problem seams related to the following regexp check in proxmox.py and the following regexp check in proxmox_kvm.py.
I can't find anywhere such a limitation in the PVE7 nor in the PVE8 official documentations in the following links :
- PVE7 GUI documentation
- PVE7 admin guide
- qm command on PVE7 (search for
tags
in the page) - PVE8 admin guide
- PVE8 GUI documentation
- qm command on PVE8 (search for
tags
in the page)
In fact, I already use uppercase characters for tags in my PVE instances since PVE7.4 without limitation : this works in the GUI and from the command line :
# qm set 121 --tags 'Debian;DEBIAN;dEBIAN'
update VM 121: -tags Debian;DEBIAN;dEBIAN
Issue Type
Bug Report
Component Name
plugins/modules/proxmox.py
plugins/modules/proxmox_kvm.py
Ansible Version
$ ansible --version
ansible [core 2.17.8]
config file = /home/myname/dev/myproject/ansible.cfg
configured module search path = ['/home/myname/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/myname/dev/myproject/venv/lib/python3.10/site-packages/ansible
ansible collection location = /home/myname/.ansible/collections:/usr/share/ansible/collections
executable location = /home/myname/dev/myproject/venv/bin/ansible
python version = 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] (/home/myname/dev/myproject/venv/bin/python3)
jinja version = 3.1.5
libyaml = False
Community.general Version
$ ansible-galaxy collection list community.general
--------------
# /home/myname/.ansible/collections/ansible_collections
Collection Version
----------------- -------
community.general 10.4.0
# /home/myname/dev/myproject/venv/lib/python3.10/site-packages/ansible_collections
Collection Version
----------------- -------
community.general 9.5.2
NB : Any version is impacted.
Configuration
This problem is not related to a particular configuration.
OS / Environment
PVE7 and PVE8 (PVE6 and below don't use tags).
Steps to Reproduce
- name: Non-working example creating new VM with tags including uppercase letters
community.general.proxmox_kvm:
api_user: root@pam
api_password: secret
api_host: helldorado
name: spynal
node: sabrewulf
tags:
- Debian
- DEBIAN
- dEBIAN
Expected Results
I expect I can set tags containing uppercase letters for my VM and containers with the proxmox
and proxmox_kvm
modules as I use to do this in the GUI interface and with the qm
command line tool.
This should work in the same way I set lowercase-only tags, for example with the following working example :
- name: Working example creating new VM with lowercase-only tags
community.general.proxmox_kvm:
api_user: root@pam
api_password: secret
api_host: helldorado
name: spynal
node: sabrewulf
tags:
- debian
- 12
- test
Actual Results
failed: [127.0.0.1] (item=myVM) => {"ansible_loop_var": "item", "changed": false, "item": "myVM", "msg": "Debian is not a valid tag"}
Code of Conduct
- I agree to follow the Ansible Code of Conduct