<liclass="toctree-l2"><aclass="reference internal"href="kubevirt.html">kubevirt – Inventory source for KubeVirt VirtualMachines and VirtualMachineInstances</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="kubevirt_vm.html">kubevirt_vm – Create or delete KubeVirt VirtualMachines</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="kubevirt.html">kubevirt – Inventory source for KubeVirt VirtualMachines and VirtualMachineInstances</a></li>
<liclass="toctree-l2"><aclass="reference internal"href="kubevirt_vm.html">kubevirt_vm – Create or delete KubeVirt VirtualMachines</a></li>
<h1>kubevirt_vmi_info – Describe KubeVirt VirtualMachineInstances<aclass="headerlink"href="#kubevirt-vmi-info-describe-kubevirt-virtualmachineinstances"title="Link to this heading"></a></h1>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<p>This module is part of the <aclass="reference external"href="https://galaxy.ansible.com/ui/repo/published/kubevirt/core/">kubevirt.core collection</a>.</p>
<p>It is not included in <codeclass="docutils literal notranslate"><spanclass="pre">ansible-core</span></code>.
To check whether it is installed, run <codeclass="code docutils literal notranslate"><spanclass="pre">ansible-galaxy</span><spanclass="pre">collection</span><spanclass="pre">list</span></code>.</p>
You need further requirements to be able to use this module,
see <aclass="reference internal"href="#ansible-collections-kubevirt-core-kubevirt-vmi-info-module-requirements"><spanclass="std std-ref">Requirements</span></a> for details.</p>
<p>To use it in a playbook, specify: <codeclass="code docutils literal notranslate"><spanclass="pre">kubevirt.core.kubevirt_vmi_info</span></code>.</p>
<h2><aclass="toc-backref"href="#id1"role="doc-backlink">Synopsis</a><aclass="headerlink"href="#synopsis"title="Link to this heading"></a></h2>
<ulclass="simple">
<li><p>Use the Kubernetes Python client to perform read operations on KubeVirt <codeclass="docutils literal notranslate"><spanclass="pre">VirtualMachineInstances</span></code>.</p></li>
<li><p>Pass options to find <codeclass="docutils literal notranslate"><spanclass="pre">VirtualMachineInstances</span></code> as module arguments.</p></li>
<li><p>Authenticate using either a config file, certificates, password or token.</p></li>
<li><p>Supports check mode.</p></li>
</ul>
</section>
<sectionid="requirements">
<spanid="ansible-collections-kubevirt-core-kubevirt-vmi-info-module-requirements"></span><h2><aclass="toc-backref"href="#id2"role="doc-backlink">Requirements</a><aclass="headerlink"href="#requirements"title="Link to this heading"></a></h2>
<p>The below requirements are needed on the host that executes this module.</p>
<ulclass="simple">
<li><p>python >= 3.9</p></li>
<li><p>kubernetes >= 28.1.0</p></li>
<li><p>PyYAML >= 3.11</p></li>
</ul>
</section>
<sectionid="parameters">
<h2><aclass="toc-backref"href="#id3"role="doc-backlink">Parameters</a><aclass="headerlink"href="#parameters"title="Link to this heading"></a></h2>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_IMPERSONATE_GROUPS</code> environment variable, e.g. <codeclass='docutils literal notranslate'>Group1,Group2</code>.</p>
<aclass="ansibleOptionLink"href="#parameter-kubeconfig"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">any</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>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 <em>~/.kube/config</em>.</p>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_KUBECONFIG</code> environment variable.</p>
<p>Multiple Kubernetes config file can be provided using separator <codeclass='docutils literal notranslate'>;</code> for Windows platform or <codeclass='docutils literal notranslate'>:</code> for others platforms.</p>
<p>The kubernetes configuration can be provided as dictionary. This feature requires a python kubernetes client version >= 17.17.0.</p>
<aclass="ansibleOptionLink"href="#parameter-no_proxy"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">string</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>The comma separated list of hosts/domains/IP/CIDR that shouldn't go through proxy.</p>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_NO_PROXY</code> environment variable.</p>
<p>Please note that this module does not pick up typical proxy settings from the environment (e.g. <codeclass="xref std std-envvar literal notranslate">NO_PROXY</code>).</p>
<p>This feature requires <codeclass='docutils literal notranslate'>kubernetes>=19.15.0</code>. When kubernetes library is less than 19.15.0, it fails even no_proxy set in correct.</p>
<p>Example value is <codeclass='docutils literal notranslate'>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</code>.</p>
<aclass="ansibleOptionLink"href="#parameter-password"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">string</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>Provide a password for authenticating with the API.</p>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_PASSWORD</code> environment variable.</p>
<p>Please read the description of the <codeclass="ansible-option literal notranslate"><strong><aclass="reference internal"href="#parameter-username"><spanclass="std std-ref"><spanclass="pre">username</span></span></a></strong></code> option for a discussion of when this option is applicable.</p>
<aclass="ansibleOptionLink"href="#parameter-persist_config"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">boolean</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>Whether or not to save the kube config refresh tokens.</p>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_PERSIST_CONFIG</code> environment variable.</p>
<p>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.</p>
<aclass="ansibleOptionLink"href="#parameter-proxy"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">string</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>The URL of an HTTP proxy to use for the connection.</p>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_PROXY</code> environment variable.</p>
<p>Please note that this module does not pick up typical proxy settings from the environment (e.g. <codeclass="xref std std-envvar literal notranslate">HTTP_PROXY</code>).</p>
<p>Documentation can be found here <ahref='https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html?highlight=proxy_headers#urllib3.util.make_headers'>https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html?highlight=proxy_headers#urllib3.util.make_headers</a>.</p>
<p>Colon-separated username:password for proxy basic authentication header.</p>
<p>Can also be specified via <codeclass="xref std std-envvar literal notranslate">K8S_AUTH_PROXY_HEADERS_PROXY_BASIC_AUTH</code> environment variable.</p>
<aclass="ansibleOptionLink"href="#parameter-wait_sleep"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">integer</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>Number of seconds to sleep between checks.</p>
<p>Ignored if <codeclass="ansible-option literal notranslate"><strong><aclass="reference internal"href="#parameter-wait"><spanclass="std std-ref"><spanclass="pre">wait</span></span></a></strong></code> is not set.</p>
<aclass="ansibleOptionLink"href="#parameter-wait_timeout"title="Permalink to this option"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">integer</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>How long in seconds to wait for the resource to end up in the ready state.</p>
<p>Ignored if <codeclass="ansible-option literal notranslate"><strong><aclass="reference internal"href="#parameter-wait"><spanclass="std std-ref"><spanclass="pre">wait</span></span></a></strong></code> is not set.</p>
<h2><aclass="toc-backref"href="#id4"role="doc-backlink">Notes</a><aclass="headerlink"href="#notes"title="Link to this heading"></a></h2>
<divclass="admonition note">
<pclass="admonition-title">Note</p>
<ulclass="simple">
<li><p>To avoid SSL certificate validation errors when <codeclass="ansible-option-value docutils literal notranslate"><span><spanclass="pre">validate_certs=yes</span></span></code>, the full certificate chain for the API server must be provided via <codeclass="ansible-option docutils literal notranslate"><strong><span><spanclass="pre">ca_cert</span></span></strong></code> or in the <codeclass="ansible-option docutils literal notranslate"><strong><span><spanclass="pre">kubeconfig</span></span></strong></code> file.</p></li>
</ul>
</div>
</section>
<sectionid="examples">
<h2><aclass="toc-backref"href="#id5"role="doc-backlink">Examples</a><aclass="headerlink"href="#examples"title="Link to this heading"></a></h2>
<divclass="highlight-yaml+jinja notranslate"><divclass="highlight"><pre><span></span><spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Get an existing VirtualMachineInstance</span>
<spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Get a list of all VirtualMachinesInstances</span>
<spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Get a list of all VirtualMachineInstances from any namespace</span>
<spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Search for all VirtualMachineInstances labelled app=test</span>
<spanclass="p p-Indicator">-</span><spanclass="w"></span><spanclass="nt">name</span><spanclass="p">:</span><spanclass="w"></span><spanclass="l l-Scalar l-Scalar-Plain">Wait until the VirtualMachineInstace is ready</span>
<h2><aclass="toc-backref"href="#id6"role="doc-backlink">Return Values</a><aclass="headerlink"href="#return-values"title="Link to this heading"></a></h2>
<p>Common return values are documented <aclass="reference external"href="https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values"title="(in Ansible v10)"><spanclass="xref std std-ref">here</span></a>, the following are the fields unique to this module:</p>
<aclass="ansibleOptionLink"href="#return-api_found"title="Permalink to this return value"></a>
<pclass="ansible-option-type-line">
<spanclass="ansible-option-type">boolean</span>
</p>
</div></td>
<td><divclass="ansible-option-cell">
<p>Whether the specified <codeclass="ansible-option literal notranslate"><strong><aclass="reference internal"href="#parameter-api_version"><spanclass="std std-ref"><spanclass="pre">api_version</span></span></a></strong></code> and <codeclass='docutils literal notranslate'>VirtualMachineInstance</code><codeclass='docutils literal notranslate'>Kind</code> were successfully mapped to an existing API on the target cluster.</p>
<p>Specific attributes of the <codeclass='docutils literal notranslate'>VirtualMachineInstance</code>. Can vary based on the <codeclass="ansible-option literal notranslate"><strong><aclass="reference internal"href="#parameter-api_version"><spanclass="std std-ref"><spanclass="pre">api_version</span></span></a></strong></code>.</p>
provided by <ahref="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function(){
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.