.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. role:: ansible-attribute-support-label .. role:: ansible-attribute-support-property .. role:: ansible-attribute-support-full .. role:: ansible-attribute-support-partial .. role:: ansible-attribute-support-none .. role:: ansible-attribute-support-na .. role:: ansible-option-type .. role:: ansible-option-elements .. role:: ansible-option-required .. role:: ansible-option-versionadded .. role:: ansible-option-aliases .. role:: ansible-option-choices .. role:: ansible-option-choices-default-mark .. role:: ansible-option-default-bold .. role:: ansible-option-configuration .. role:: ansible-option-returned-bold .. role:: ansible-option-sample-bold .. Anchors .. _ansible_collections.kubevirt.core.kubevirt_vm_info_module: .. Anchors: short name for ansible.builtin .. Title kubevirt_vm_info -- Describe VirtualMachines on Kubernetes +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This module is part of the `kubevirt.core collection `_. To install it, use: :code:`ansible-galaxy collection install kubevirt.core`. You need further requirements to be able to use this module, see :ref:`Requirements ` for details. To use it in a playbook, specify: :code:`kubevirt.core.kubevirt_vm_info`. .. version_added .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - Use the Kubernetes Python client to perform read operations on KubeVirt VirtualMachines. - Pass options to find VirtualMachines as module arguments. - Authenticate using either a config file, certificates, password or token. - Supports check mode. .. Aliases .. Requirements .. _ansible_collections.kubevirt.core.kubevirt_vm_info_module_requirements: Requirements ------------ The below requirements are needed on the host that executes this module. - python \>= 3.6 - kubernetes \>= 12.0.0 .. Options Parameters ---------- .. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 * - Parameter - Comments * - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-api_key: .. rst-class:: ansible-option-title **api_key** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Token used to authenticate with the API. Can also be specified via K8S\_AUTH\_API\_KEY environment variable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-api_version: .. rst-class:: ansible-option-title **api_version** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Use this to set the API version of KubeVirt. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`"kubevirt.io/v1"` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-ca_cert: .. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-ssl_ca_cert: .. rst-class:: ansible-option-title **ca_cert** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-aliases:`aliases: ssl_ca_cert` .. rst-class:: ansible-option-type-line :ansible-option-type:`path` .. raw:: html
- .. raw:: html
Path to a CA certificate used to authenticate with the API. The full certificate chain must be provided to avoid certificate validation errors. Can also be specified via K8S\_AUTH\_SSL\_CA\_CERT environment variable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-cert_file: .. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-client_cert: .. rst-class:: ansible-option-title **client_cert** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-aliases:`aliases: cert_file` .. rst-class:: ansible-option-type-line :ansible-option-type:`path` .. raw:: html
- .. raw:: html
Path to a certificate used to authenticate with the API. Can also be specified via K8S\_AUTH\_CERT\_FILE environment variable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-client_key: .. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-key_file: .. rst-class:: ansible-option-title **client_key** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-aliases:`aliases: key_file` .. rst-class:: ansible-option-type-line :ansible-option-type:`path` .. raw:: html
- .. raw:: html
Path to a key file used to authenticate with the API. Can also be specified via K8S\_AUTH\_KEY\_FILE environment variable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-context: .. rst-class:: ansible-option-title **context** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
The name of a context found in the config file. Can also be specified via K8S\_AUTH\_CONTEXT environment variable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-field_selectors: .. rst-class:: ansible-option-title **field_selectors** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
List of field selectors to use to filter results .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`[]` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-host: .. rst-class:: ansible-option-title **host** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Provide a URL for accessing the API. Can also be specified via K8S\_AUTH\_HOST environment variable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-impersonate_groups: .. rst-class:: ansible-option-title **impersonate_groups** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` :ansible-option-versionadded:`added in kubernetes.core 2.3.0` .. raw:: html
- .. raw:: html
Group(s) to impersonate for the operation. Can also be specified via K8S\_AUTH\_IMPERSONATE\_GROUPS environment. Example: Group1,Group2 .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-impersonate_user: .. rst-class:: ansible-option-title **impersonate_user** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` :ansible-option-versionadded:`added in kubernetes.core 2.3.0` .. raw:: html
- .. raw:: html
Username to impersonate for the operation. Can also be specified via K8S\_AUTH\_IMPERSONATE\_USER environment. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-kubeconfig: .. rst-class:: ansible-option-title **kubeconfig** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`any` .. raw:: html
- .. raw:: html
Path to an existing Kubernetes config file. If not provided, and no other connection options are provided, the Kubernetes client will attempt to load the default configuration file from \ :emphasis:`~/.kube/config`\ . Can also be specified via K8S\_AUTH\_KUBECONFIG environment variable. Multiple Kubernetes config file can be provided using separator ';' for Windows platform or ':' for others platforms. The kubernetes configuration can be provided as dictionary. This feature requires a python kubernetes client version \>= 17.17.0. Added in version 2.2.0. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-label_selectors: .. rst-class:: ansible-option-title **label_selectors** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
List of label selectors to use to filter results .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`[]` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-name: .. rst-class:: ansible-option-title **name** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Specify the name of the VirtualMachine. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-namespace: .. rst-class:: ansible-option-title **namespace** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Specify the namespace of VirtualMachines. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-no_proxy: .. rst-class:: ansible-option-title **no_proxy** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` :ansible-option-versionadded:`added in kubernetes.core 2.3.0` .. raw:: html
- .. raw:: html
The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy. Can also be specified via K8S\_AUTH\_NO\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. NO\_PROXY). This feature requires kubernetes\>=19.15.0. When kubernetes library is less than 19.15.0, it fails even no\_proxy set in correct. example value is "localhost,.local,.example.com,127.0.0.1,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16" .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-password: .. rst-class:: ansible-option-title **password** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Provide a password for authenticating with the API. Can also be specified via K8S\_AUTH\_PASSWORD environment variable. Please read the description of the \ :literal:`username`\ option for a discussion of when this option is applicable. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-persist_config: .. rst-class:: ansible-option-title **persist_config** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Whether or not to save the kube config refresh tokens. Can also be specified via K8S\_AUTH\_PERSIST\_CONFIG environment variable. When the k8s context is using a user credentials with refresh tokens (like oidc or gke/gcloud auth), the token is refreshed by the k8s python client library but not saved by default. So the old refresh token can expire and the next auth might fail. Setting this flag to true will tell the k8s python client to save the new refresh token to the kube config file. Default to false. Please note that the current version of the k8s python client library does not support setting this flag to True yet. The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169 .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-proxy: .. rst-class:: ansible-option-title **proxy** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
The URL of an HTTP proxy to use for the connection. Can also be specified via K8S\_AUTH\_PROXY environment variable. Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP\_PROXY). .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-proxy_headers: .. rst-class:: ansible-option-title **proxy_headers** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` :ansible-option-versionadded:`added in kubernetes.core 2.0.0` .. raw:: html
- .. raw:: html
The Header used for the HTTP proxy. Documentation can be found here \ https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html?highlight=proxy_headers#urllib3.util.make_headers\ . .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-proxy_headers/basic_auth: .. rst-class:: ansible-option-title **basic_auth** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Colon-separated username:password for basic authentication header. Can also be specified via K8S\_AUTH\_PROXY\_HEADERS\_BASIC\_AUTH environment. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-proxy_headers/proxy_basic_auth: .. rst-class:: ansible-option-title **proxy_basic_auth** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Colon-separated username:password for proxy basic authentication header. Can also be specified via K8S\_AUTH\_PROXY\_HEADERS\_PROXY\_BASIC\_AUTH environment. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-proxy_headers/user_agent: .. rst-class:: ansible-option-title **user_agent** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
String representing the user-agent you want, such as foo/1.0. Can also be specified via K8S\_AUTH\_PROXY\_HEADERS\_USER\_AGENT environment. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-username: .. rst-class:: ansible-option-title **username** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Provide a username for authenticating with the API. Can also be specified via K8S\_AUTH\_USERNAME environment variable. Please note that this only works with clusters configured to use HTTP Basic Auth. If your cluster has a different form of authentication (e.g. OAuth2 in OpenShift), this option will not work as expected and you should look into the \ :ref:`community.okd.k8s\_auth `\ module, as that might do what you need. .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-validate_certs: .. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-verify_ssl: .. rst-class:: ansible-option-title **validate_certs** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-aliases:`aliases: verify_ssl` .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Whether or not to verify the API server's SSL certificates. Can also be specified via K8S\_AUTH\_VERIFY\_SSL environment variable. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-wait: .. rst-class:: ansible-option-title **wait** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Whether to wait for the VirtualMachine to end up in the ready state. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry-default:`false` :ansible-option-choices-default-mark:`← (default)` - :ansible-option-choices-entry:`true` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-wait_sleep: .. rst-class:: ansible-option-title **wait_sleep** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`integer` .. raw:: html
- .. raw:: html
Number of seconds to sleep between checks. Ignored if \ :literal:`wait`\ is not set. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`5` .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__parameter-wait_timeout: .. rst-class:: ansible-option-title **wait_timeout** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`integer` .. raw:: html
- .. raw:: html
How long in seconds to wait for the resource to end up in the desired state. Ignored if \ :literal:`wait`\ is not set. .. rst-class:: ansible-option-line :ansible-option-default-bold:`Default:` :ansible-option-default:`120` .. raw:: html
.. Attributes .. Notes Notes ----- .. note:: - To avoid SSL certificate validation errors when \ :literal:`validate\_certs`\ is \ :emphasis:`True`\ , the full certificate chain for the API server must be provided via \ :literal:`ca\_cert`\ or in the kubeconfig file. .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja - name: Get an existing VirtualMachine kubevirt.core.kubevirt_vm_info: name: testvm namespace: default register: default_testvm - name: Get a list of all VirtualMachines kubevirt.core.kubevirt_vm_info: namespace: default register: vm_list - name: Get a list of all VirtualMachines from any namespace kubevirt.core.kubevirt_vm_info: register: vm_list - name: Search for all VirtualMachines labelled app=test kubevirt.core.kubevirt_vm_info: label_selectors: - app=test - name: Wait until the VirtualMachine is Ready kubevirt.core.kubevirt_vm_info: name: testvm namespace: default wait: yes .. Facts .. Return values Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: .. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 * - Key - Description * - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-api_found: .. rst-class:: ansible-option-title **api_found** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Whether the specified api\_version and VirtualMachine kind were successfully mapped to an existing API on the targeted cluster. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` always .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-resources: .. rst-class:: ansible-option-title **resources** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`complex` .. raw:: html
- .. raw:: html
The VirtualMachine(s) that exists .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` success .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-resources/api_version: .. rst-class:: ansible-option-title **api_version** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
The versioned schema of this representation of an object. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` success .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-resources/kind: .. rst-class:: ansible-option-title **kind** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Represents the REST resource this object represents. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` success .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-resources/metadata: .. rst-class:: ansible-option-title **metadata** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Standard object metadata. Includes name, namespace, annotations, labels, etc. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` success .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-resources/spec: .. rst-class:: ansible-option-title **spec** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Specific attributes of the VirtualMachine. Can vary based on the \ :emphasis:`api\_version`\ . .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` success .. raw:: html
* - .. raw:: html
.. _ansible_collections.kubevirt.core.kubevirt_vm_info_module__return-resources/status: .. rst-class:: ansible-option-title **status** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`dictionary` .. raw:: html
- .. raw:: html
Current status details for the VirtualMachine. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` success .. raw:: html
.. Status (Presently only deprecated) .. Authors Authors ~~~~~~~ - KubeVirt.io Project .. Extra links .. Parsing errors