Open PC-Admin opened 1 year ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @Ajpantuso @Thulium-Drake @helldorado @joshainglis @karmab @tleguern click here for bot help
Looks like the documentation needs to be fixed and that wrong example be removed.
Is there actually any way of probing if a VM exists with proxmox_kvm right now?
I'm very curious if anyone has an example that does work.
I created #6498 to remove that example. I cannot answer your question since I'm not familiar with the proxmox modules, maybe some of the module maintainers can answer this.
I'm leaving this issue open as a Feature Request for adding querying functionality. A proxmox_kvm_info
module would surely be nice to have and should provide the information you need.
I'm leaving this issue open as a Feature Request for adding querying functionality. A proxmox_kvm_info module would surely be nice to have and should provide the information you need.
That would be fantastic. :) Thank you for cleaning up these docs, it'll help other people experimenting with these modules.
cc @UnderGreen click here for bot help
Hey @felixfontein, I'm using state: current
on 7.1.0 of community.general and this is working for me. I also just opened #6828 to add additional functionality to this state.
@PC-Admin it looks like you're using community.general.proxmox
, when you'll actually want to use community.general.proxmox_kvm
to get the state of a VM.
In my case, the task looks like the following:
- name: Get VM state
community.general.proxmox_kvm:
proxmox_default_behavior: no_defaults
api_user: "{{ pmox_user }}"
api_password: "{{ pmox_password }}"
api_host: "{{ pmox_url }}"
node: "{{ vm_node }}"
name: "{{ vm_name }}"
state: current
register: vm_state
It also looks like we had a small mix-up on #6498, since the module name being referenced by OP was community.general.proxmox
. The example removed from community.general.proxmox_kvm
is valid and working
Thanks for noticiting this! I've reverted the commit in #6832.
In any case, state current
should be deprecated and removed and replaced by a proper proxmox_kvm_info
module. And a proxmox_info
module is apparently also missing...
Creating info modules isn't hard, so if someone wants to contribute one (or two)... :)
@PC-Admin, @drewburr Done via https://github.com/ansible-collections/community.general/pull/6852. Let me know if the new module fits your needs.
cc @krauthosting click here for bot help
Summary
In the docs one of the available for options for state is apparently 'current':
https://docs.ansible.com/ansible/latest/collections/community/general/proxmox_kvm_module.html#parameter-state
Yet this doesn't actually appear to be an option? This code:
generates this error:
Issue Type
Documentation Report
Component Name
proxmox_kvm
Ansible Version
Community.general Version
Configuration
OS / Environment
Debian 12 Bookworm
Steps to Reproduce
(see summary for code example) With code like this, and the latest community.general modules installed, try and query proxmox using
state: current
Expected Results
That this option, as it's explained in the documentation, would actually exist/function. (or at least there would be no mention of it in the docs)
Actual Results
(see summary for error message)
Code of Conduct