Update docs for main

Signed-off-by: kubevirt-bot <kubevirtbot@redhat.com>
This commit is contained in:
kubevirt-bot
2026-08-10 13:13:48 +00:00
parent 1d5e2ae95f
commit cba0086ca5
36 changed files with 2458 additions and 758 deletions
+28
View File
@@ -6,6 +6,34 @@ KubeVirt Collection for Ansible Release Notes
This changelog describes changes after version 1.0.0.
v2.3.0
======
Release Summary
---------------
This release adds support for managing VM lifecycle using state=started/stopped/restarted in kubevirt_vm and introduces the default_win_ansible_connection option for the inventory plugin. It also fixes the handling of the user-configured strict option in the inventory plugin and adds compatibility with ansible-core 2.21.
Minor Changes
-------------
- chore(ci): add ansible 2.21 and fix docs build `#237 <https://github.com/kubevirt/kubevirt.core/pull/237>`_
- feat(inventory): add ``default_win_ansible_connection`` option `#240 <https://github.com/kubevirt/kubevirt.core/pull/240>`_
- feat(kubevirt_vm): add ``state=started/stopped/restarted`` to manage VM lifecycle `#242 <https://github.com/kubevirt/kubevirt.core/pull/242>`_
Bugfixes
--------
- fix: pass user-configured ``strict`` option to ``_set_composite_vars`` in kubevirt inventory plugin `#235 <https://github.com/kubevirt/kubevirt.core/pull/235>`_
v2.2.4
======
Release Summary
---------------
This is a service release with updated versions and dependencies.
v2.2.3
======
+1 -1
View File
@@ -8,7 +8,7 @@ This repository hosts the `kubevirt.core` Ansible Collection, which provides vir
<!--start requires_ansible -->
## Ansible and Python version compatibility
This collection has been tested against Ansible versions **>=2.16,<=2.20** and Python versions **>=3.10,<=3.14**.
This collection has been tested against Ansible versions **>=2.16,<=2.21** and Python versions **>=3.10,<=3.14**.
See the [Ansible core support matrix](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix) for supported combinations.
<!--end requires_ansible -->
+20 -3
View File
@@ -12,13 +12,30 @@
- All arguments have a specification in `meta/argument_specs.yml`
- All playbooks/roles should be focused on compatibility with Ansible Automation Platform
### Before pushing
- Run `make format` before committing to auto-format the code. CI rejects unformatted PRs.
- CI runs `yamllint`, `ansible-lint` (production profile) and `shellcheck`. Fix any violations before pushing
## Development environment
To develop and to run tests you need to install `tox` and `tox-ansible` on
your machine.
Install `tox` (version 4 or newer) and `tox-ansible`:
```
pip install --user tox tox-ansible
pip install --user 'tox>=4' tox-ansible
```
With `--user`, `tox` is in `~/.local/bin`. Put it first on `PATH` before
`make` targets that use `tox` (`build-venv`, `test-unit`, `test-sanity`):
```
export PATH="$HOME/.local/bin:$PATH" # whole shell session
```
or
```
PATH="$HOME/.local/bin:$PATH" make <target> # command only
```
### Virtualenv for development
+61 -34
View File
@@ -6,7 +6,7 @@
:trim:
.. meta::
:antsibull-docs: 2.23.0
:antsibull-docs: 2.25.0
.. Anchors
@@ -443,6 +443,33 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-default_win_ansible_connection"></div>
<p class="ansible-option-title"><strong>default_win_ansible_connection</strong></p>
<a class="ansibleOptionLink" href="#parameter-default_win_ansible_connection" title="Permalink to this option"></a>
<p class="ansible-option-type-line">
<span class="ansible-option-type">string</span>
</p>
<p><em class="ansible-option-versionadded">added in kubevirt.core 2.3.0</em></p>
</div></td>
<td><div class="ansible-option-cell">
<p>Set the default value of <code class='docutils literal notranslate'>ansible_connection</code> when a Windows virtual machines is detected.</p>
<p>Common values include <code class="ansible-value literal notranslate">winrm</code>, <code class="ansible-value literal notranslate">ansible.builtin.winrm</code>, <code class="ansible-value literal notranslate">psrp</code>, <code class="ansible-value literal notranslate">ansible.builtin.psrp</code>, <code class="ansible-value literal notranslate">ssh</code>, and <code class="ansible-value literal notranslate">ansible.builtin.ssh</code>.</p>
<p>When set to <code class="ansible-value literal notranslate">ssh</code> or <code class="ansible-value literal notranslate">ansible.builtin.ssh</code>, the service port lookup uses SSH port (22) instead of WinRM/PSRP ports (5986/5985).</p>
<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
<ul class="simple">
<li><p><code class="ansible-value literal notranslate ansible-option-default-bold"><strong>&#34;winrm&#34;</strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;ansible.builtin.winrm&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;psrp&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;ansible.builtin.psrp&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;ssh&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;ansible.builtin.ssh&#34;</code></p></li>
</ul>
</div></td>
</tr>
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-groups"></div>
<p class="ansible-option-title"><strong>groups</strong></p>
@@ -457,7 +484,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">{}</code></p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-host"></div>
<p class="ansible-option-title"><strong>host</strong></p>
@@ -472,7 +499,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_HOST</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-host_format"></div>
<p class="ansible-option-title"><strong>host_format</strong></p>
@@ -487,7 +514,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">&#34;{namespace}-{name}&#34;</code></p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-impersonate_groups"></div>
<p class="ansible-option-title"><strong>impersonate_groups</strong></p>
@@ -503,7 +530,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_IMPERSONATE_GROUPS</code> environment variable, e.g. <code class='docutils literal notranslate'>Group1,Group2</code>.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-impersonate_user"></div>
<p class="ansible-option-title"><strong>impersonate_user</strong></p>
@@ -518,7 +545,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_IMPERSONATE_USER</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups"></div>
<p class="ansible-option-title"><strong>keyed_groups</strong></p>
@@ -534,7 +561,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">[]</code></p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups/default_value"></div>
<p class="ansible-option-title"><strong>default_value</strong></p>
@@ -550,7 +577,7 @@ Parameters
<p>This option is mutually exclusive with <code class="ansible-option literal notranslate"><strong><a class="reference internal" href="#parameter-keyed_groups/trailing_separator"><span class="std std-ref"><span class="pre">keyed_groups[].trailing_separator</span></span></a></strong></code>.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups/key"></div>
<p class="ansible-option-title"><strong>key</strong></p>
@@ -564,7 +591,7 @@ Parameters
<p>The key from input dictionary used to generate groups.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups/parent_group"></div>
<p class="ansible-option-title"><strong>parent_group</strong></p>
@@ -578,7 +605,7 @@ Parameters
<p>parent group for keyed group.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups/prefix"></div>
<p class="ansible-option-title"><strong>prefix</strong></p>
@@ -593,7 +620,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">&#34;&#34;</code></p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups/separator"></div>
<p class="ansible-option-title"><strong>separator</strong></p>
@@ -608,7 +635,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">&#34;_&#34;</code></p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-keyed_groups/trailing_separator"></div>
<p class="ansible-option-title"><strong>trailing_separator</strong></p>
@@ -631,7 +658,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-kube_secondary_dns"></div>
<p class="ansible-option-title"><strong>kube_secondary_dns</strong></p>
@@ -651,7 +678,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-kubeconfig"></div>
<p class="ansible-option-title"><strong>kubeconfig</strong></p>
@@ -668,7 +695,7 @@ Parameters
<p>The kubernetes configuration can be provided as dictionary. This feature requires a python kubernetes client version &gt;= 17.17.0.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-label_selector"></div>
<p class="ansible-option-title"><strong>label_selector</strong></p>
@@ -682,7 +709,7 @@ Parameters
<p>Define a label selector to select a subset of the fetched virtual machines.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-leading_separator"></div>
<p class="ansible-option-title"><strong>leading_separator</strong></p>
@@ -708,7 +735,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-name"></div>
<p class="ansible-option-title"><strong>name</strong></p>
@@ -722,7 +749,7 @@ Parameters
<p>Optional name to assign to the cluster. If not provided, a name is constructed from the server and port.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-namespaces"></div>
<p class="ansible-option-title"><strong>namespaces</strong></p>
@@ -736,7 +763,7 @@ Parameters
<p>List of namespaces. If not specified, will fetch virtual machines from all namespaces the user is authorized to access.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-network_name"></div>
<div class="ansibleOptionAnchor" id="parameter-interface_name"></div>
@@ -752,7 +779,7 @@ Parameters
<p>In case multiple networks are attached to a virtual machine, define which interface should be returned as primary IP address.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-no_proxy"></div>
<p class="ansible-option-title"><strong>no_proxy</strong></p>
@@ -770,7 +797,7 @@ Parameters
<p>Example value is <code class='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>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-password"></div>
<p class="ansible-option-title"><strong>password</strong></p>
@@ -786,7 +813,7 @@ Parameters
<p>Please read the description of the <code class="ansible-option literal notranslate"><strong><a class="reference internal" href="#parameter-username"><span class="std std-ref"><span class="pre">username</span></span></a></strong></code> option for a discussion of when this option is applicable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-persist_config"></div>
<p class="ansible-option-title"><strong>persist_config</strong></p>
@@ -809,7 +836,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-plugin"></div>
<p class="ansible-option-title"><strong>plugin</strong></p>
@@ -830,7 +857,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy"></div>
<p class="ansible-option-title"><strong>proxy</strong></p>
@@ -846,7 +873,7 @@ Parameters
<p>Please note that this module does not pick up typical proxy settings from the environment (e.g. <code class="xref std std-envvar literal notranslate">HTTP_PROXY</code>).</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers"></div>
<p class="ansible-option-title"><strong>proxy_headers</strong></p>
@@ -861,7 +888,7 @@ Parameters
<p>Documentation can be found here <a href='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>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers/basic_auth"></div>
<p class="ansible-option-title"><strong>basic_auth</strong></p>
@@ -876,7 +903,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_PROXY_HEADERS_BASIC_AUTH</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers/proxy_basic_auth"></div>
<p class="ansible-option-title"><strong>proxy_basic_auth</strong></p>
@@ -891,7 +918,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_PROXY_HEADERS_PROXY_BASIC_AUTH</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers/user_agent"></div>
<p class="ansible-option-title"><strong>user_agent</strong></p>
@@ -907,7 +934,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-strict"></div>
<p class="ansible-option-title"><strong>strict</strong></p>
@@ -928,7 +955,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-unset_ansible_port"></div>
<p class="ansible-option-title"><strong>unset_ansible_port</strong></p>
@@ -949,7 +976,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-use_extra_vars"></div>
<p class="ansible-option-title"><strong>use_extra_vars</strong></p>
@@ -983,7 +1010,7 @@ Parameters
</ul>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-use_service"></div>
<p class="ansible-option-title"><strong>use_service</strong></p>
@@ -1004,7 +1031,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-username"></div>
<p class="ansible-option-title"><strong>username</strong></p>
@@ -1019,7 +1046,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_USERNAME</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-validate_certs"></div>
<div class="ansibleOptionAnchor" id="parameter-verify_ssl"></div>
+82 -31
View File
@@ -6,7 +6,7 @@
:trim:
.. meta::
:antsibull-docs: 2.23.0
:antsibull-docs: 2.25.0
.. Anchors
@@ -16,8 +16,8 @@
.. Title
kubevirt_vm -- Create or delete KubeVirt VirtualMachines
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
kubevirt_vm -- Manage KubeVirt VirtualMachines
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.. Collection note
@@ -48,7 +48,7 @@ Synopsis
.. Description
- Use the Kubernetes Python client to perform create or delete operations on KubeVirt VirtualMachines.
- Use the Kubernetes Python client to perform create, delete, start, stop, or restart operations on KubeVirt VirtualMachines.
- Pass options to create the VirtualMachine as module arguments.
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.
@@ -320,6 +320,22 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-grace_period_seconds"></div>
<p class="ansible-option-title"><strong>grace_period_seconds</strong></p>
<a class="ansibleOptionLink" href="#parameter-grace_period_seconds" title="Permalink to this option"></a>
<p class="ansible-option-type-line">
<span class="ansible-option-type">integer</span>
</p>
<p><em class="ansible-option-versionadded">added in kubevirt.core 2.3.0</em></p>
</div></td>
<td><div class="ansible-option-cell">
<p>Specify the grace period in seconds for stopping or restarting the <code class='docutils literal notranslate'>VirtualMachine</code>.</p>
<p>Only used when <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=stopped</span></span></a></code> or <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=restarted</span></span></a></code>.</p>
<p>When used with <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=restarted</span></span></a></code>, the only supported values are <code class="ansible-value literal notranslate">null</code> (use the default grace period) and <code class="ansible-value literal notranslate">0</code> (force restart immediately).</p>
</div></td>
</tr>
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-hidden_fields"></div>
<p class="ansible-option-title"><strong>hidden_fields</strong></p>
@@ -336,7 +352,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">[&#34;metadata.annotations[kubemacpool.io/transaction-timestamp]&#34;, &#34;metadata.managedFields&#34;]</code></p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-host"></div>
<p class="ansible-option-title"><strong>host</strong></p>
@@ -350,7 +366,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_HOST</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-impersonate_groups"></div>
<p class="ansible-option-title"><strong>impersonate_groups</strong></p>
@@ -365,7 +381,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_IMPERSONATE_GROUPS</code> environment variable, e.g. <code class='docutils literal notranslate'>Group1,Group2</code>.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-impersonate_user"></div>
<p class="ansible-option-title"><strong>impersonate_user</strong></p>
@@ -379,7 +395,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_IMPERSONATE_USER</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-instancetype"></div>
<p class="ansible-option-title"><strong>instancetype</strong></p>
@@ -393,7 +409,7 @@ Parameters
<p>Only used when <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=present</span></span></a></code>.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-kubeconfig"></div>
<p class="ansible-option-title"><strong>kubeconfig</strong></p>
@@ -409,7 +425,7 @@ Parameters
<p>The kubernetes configuration can be provided as dictionary. This feature requires a python kubernetes client version &gt;= 17.17.0.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-labels"></div>
<p class="ansible-option-title"><strong>labels</strong></p>
@@ -422,7 +438,7 @@ Parameters
<p>Specify labels to set on the <code class='docutils literal notranslate'>VirtualMachine</code>.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-name"></div>
<p class="ansible-option-title"><strong>name</strong></p>
@@ -437,7 +453,7 @@ Parameters
<p>Mutually exclusive with <code class="ansible-option literal notranslate"><strong><a class="reference internal" href="#parameter-generate_name"><span class="std std-ref"><span class="pre">generate_name</span></span></a></strong></code>.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-namespace"></div>
<p class="ansible-option-title"><strong>namespace</strong></p>
@@ -451,7 +467,7 @@ Parameters
<p>Specify the namespace of the <code class='docutils literal notranslate'>VirtualMachine</code>.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-no_proxy"></div>
<p class="ansible-option-title"><strong>no_proxy</strong></p>
@@ -468,7 +484,7 @@ Parameters
<p>Example value is <code class='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>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-password"></div>
<p class="ansible-option-title"><strong>password</strong></p>
@@ -483,7 +499,7 @@ Parameters
<p>Please read the description of the <code class="ansible-option literal notranslate"><strong><a class="reference internal" href="#parameter-username"><span class="std std-ref"><span class="pre">username</span></span></a></strong></code> option for a discussion of when this option is applicable.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-persist_config"></div>
<p class="ansible-option-title"><strong>persist_config</strong></p>
@@ -505,7 +521,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-preference"></div>
<p class="ansible-option-title"><strong>preference</strong></p>
@@ -519,7 +535,7 @@ Parameters
<p>Only used when <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=present</span></span></a></code>.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy"></div>
<p class="ansible-option-title"><strong>proxy</strong></p>
@@ -534,7 +550,7 @@ Parameters
<p>Please note that this module does not pick up typical proxy settings from the environment (e.g. <code class="xref std std-envvar literal notranslate">HTTP_PROXY</code>).</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers"></div>
<p class="ansible-option-title"><strong>proxy_headers</strong></p>
@@ -548,7 +564,7 @@ Parameters
<p>Documentation can be found here <a href='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>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers/basic_auth"></div>
<p class="ansible-option-title"><strong>basic_auth</strong></p>
@@ -562,7 +578,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_PROXY_HEADERS_BASIC_AUTH</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers/proxy_basic_auth"></div>
<p class="ansible-option-title"><strong>proxy_basic_auth</strong></p>
@@ -576,7 +592,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_PROXY_HEADERS_PROXY_BASIC_AUTH</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-indent"></div><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-proxy_headers/user_agent"></div>
<p class="ansible-option-title"><strong>user_agent</strong></p>
@@ -591,7 +607,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-run_strategy"></div>
<p class="ansible-option-title"><strong>run_strategy</strong></p>
@@ -615,7 +631,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-running"></div>
<p class="ansible-option-title"><strong>running</strong></p>
@@ -636,7 +652,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-spec"></div>
<p class="ansible-option-title"><strong>spec</strong></p>
@@ -650,7 +666,7 @@ Parameters
<p>See <a href='https://kubevirt.io/api-reference/main/definitions.html#_v1_virtualmachineinstancespec'>https://kubevirt.io/api-reference/main/definitions.html#_v1_virtualmachineinstancespec</a></p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-state"></div>
<p class="ansible-option-title"><strong>state</strong></p>
@@ -660,19 +676,25 @@ Parameters
</p>
</div></td>
<td><div class="ansible-option-cell">
<p>Determines if an object should be created, patched, or deleted.</p>
<p>Determines if an object should be created, patched, deleted, started, stopped, or restarted.</p>
<p>When set to <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=present</span></span></a></code>, an object will be created, if it does not already exist.</p>
<p>If set to <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=absent</span></span></a></code>, an existing object will be deleted.</p>
<p>If set to <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=present</span></span></a></code>, an existing object will be patched, if its attributes differ from those specified.</p>
<p>If set to <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=started</span></span></a></code>, it will be ensured that the <code class='docutils literal notranslate'>VirtualMachine</code> is running. Added in version 2.3.0.</p>
<p>If set to <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=stopped</span></span></a></code>, it will be ensured that the <code class='docutils literal notranslate'>VirtualMachine</code> is stopped. Added in version 2.3.0.</p>
<p>If set to <code class="ansible-option-value literal notranslate"><a class="reference internal" href="#parameter-state"><span class="std std-ref"><span class="pre">state=restarted</span></span></a></code>, it will be ensured that the <code class='docutils literal notranslate'>VirtualMachine</code> is restarted. Added in version 2.3.0.</p>
<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
<ul class="simple">
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;absent&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-default-bold"><strong>&#34;present&#34;</strong></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;restarted&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;started&#34;</code></p></li>
<li><p><code class="ansible-value literal notranslate ansible-option-choices-entry">&#34;stopped&#34;</code></p></li>
</ul>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-username"></div>
<p class="ansible-option-title"><strong>username</strong></p>
@@ -686,7 +708,7 @@ Parameters
<p>Can also be specified via <code class="xref std std-envvar literal notranslate">K8S_AUTH_USERNAME</code> environment variable.</p>
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-validate_certs"></div>
<div class="ansibleOptionAnchor" id="parameter-verify_ssl"></div>
@@ -708,7 +730,7 @@ Parameters
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-wait"></div>
<p class="ansible-option-title"><strong>wait</strong></p>
@@ -727,7 +749,7 @@ Parameters
</div></td>
</tr>
<tr class="row-even">
<tr class="row-odd">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-wait_sleep"></div>
<p class="ansible-option-title"><strong>wait_sleep</strong></p>
@@ -742,7 +764,7 @@ Parameters
<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-value literal notranslate ansible-option-default">5</code></p>
</div></td>
</tr>
<tr class="row-odd">
<tr class="row-even">
<td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-wait_timeout"></div>
<p class="ansible-option-title"><strong>wait_timeout</strong></p>
@@ -866,6 +888,35 @@ Examples
namespace: default
state: absent
- name: Start a VirtualMachine
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
state: started
wait: true
- name: Stop a VirtualMachine
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
state: stopped
wait: true
- name: Restart a VirtualMachine
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
state: restarted
wait: true
- name: Force restart a VirtualMachine
kubevirt.core.kubevirt_vm:
name: testvm
namespace: default
state: restarted
grace_period_seconds: 0
wait: true
.. Facts
@@ -6,7 +6,7 @@
:trim:
.. meta::
:antsibull-docs: 2.23.0
:antsibull-docs: 2.25.0
.. Anchors
@@ -6,7 +6,7 @@
:trim:
.. meta::
:antsibull-docs: 2.23.0
:antsibull-docs: 2.25.0
.. Anchors
+10 -1
View File
@@ -27,6 +27,16 @@ Run unit tests with `tox-ansible` like so:
make test-unit
```
`make test-unit` runs the full matrix in parallel. For local development, run
one environment instead. If you installed tox with `--user`, put `~/.local/bin`
first on `PATH` before running `tox`. See [developing.md](developing.md).
```
tox -e unit-py3.11-2.16 --ansible --conf tox-ansible.ini
```
List available unit envs with `tox -f unit --ansible --conf tox-ansible.ini -l`.
### Running tests with ansible-test
In order to test changes with `ansible-test`, it is recommended to bind mount
@@ -135,4 +145,3 @@ ansible-playbook -i examples/inventory.kubevirt.yml examples/play-delete.yml
# terminate the environment
hack/e2e-setup.sh --cleanup
```