chore(inventory): Add examples for stopped VMs

Add examples that show how to use the collection with stopped VMs.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
Felix Matouschek
2024-06-27 13:35:11 +02:00
parent f3b40ffdbd
commit 5e1271b609
2 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
---
plugin: kubevirt.core.kubevirt

View File

@@ -0,0 +1,29 @@
---
- name: Playbook creating a stopped virtual machine
hosts: localhost
tasks:
- name: Create VM
kubevirt.core.kubevirt_vm:
state: present
name: testvm-stopped
namespace: default
running: false
instancetype:
name: u1.medium
preference:
name: fedora
spec:
domain:
devices: {}
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