Files
kubevirt.core/examples/play-create-run-strategy.yml
Felix Matouschek c1f651d972 feat(kubevirt_vm): Add support for RunStrategy
This change adds support for setting the RunStrategy of a VM.

Depending on the value set the wait condition for the VM is adjusted.
For the values Always, RerunOnFailure or Once the wait condition will
wait for the VM to run and be ready. For the value Halted the wait
condition will wait for the VM to not exist. For the value Manual
the wait condition is not set.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-07-16 10:20:09 +02:00

43 lines
1.1 KiB
YAML

---
- name: Playbook creating a virtual machine with multus network
hosts: localhost
tasks:
- name: Create VM
kubevirt.core.kubevirt_vm:
state: present
name: testvm
namespace: default
labels:
app: test
instancetype:
name: u1.medium
preference:
name: fedora
run_strategy: Manual
spec:
domain:
devices:
interfaces:
- name: default
masquerade: {}
- name: bridge-network
bridge: {}
networks:
- name: default
pod: {}
- name: bridge-network
multus:
networkName: kindexgw
volumes:
- containerDisk:
image: quay.io/containerdisks/fedora:latest
name: containerdisk
- cloudInitNoCloud:
userData: |-
#cloud-config
# The default username is: fedora
ssh_authorized_keys:
- ssh-ed25519 AAAA...
name: cloudinit
wait: true