forked from kubevirt/ansible-kubevirt-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubevirt_raw_vm.yml
60 lines (60 loc) · 2.34 KB
/
kubevirt_raw_vm.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
- name: Deploy a VM with cloud-init data
hosts: localhost
connection: local
vars:
ansible_python_interpreter: "/usr/bin/env python"
tasks:
- name: create test-fedora VM using kubevirt_raw
kubevirt_raw:
state: present
name: test-fedora
namespace: default
inline:
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachine
metadata:
name: test-fedora
namespace: default
labels:
kubevirt.io/vm: test
spec:
running: true
template:
metadata:
labels:
kubevirt.io/vm: test
spec:
domain:
resources:
requests:
memory: 512M
devices:
disks:
- volumeName: myvolume
name: mydisk
disk:
bus: virtio
- name: cloudinitdisk
volumeName: cloudinitvolume
cdrom:
bus: virtio
volumes:
- name: myvolume
registryDisk:
image: kubevirt/fedora-cloud-registry-disk-demo:latest
- cloudInitNoCloud:
userData: |
#cloud-config
hostname: test-fedora
users:
- name: kubevirt
gecos: KubeVirt Project
sudo: ALL=(ALL) NOPASSWD:ALL
passwd: $6$JXbc3063IJir.e5h$ypMlYScNMlUtvQ8Il1ldZi/mat7wXTiRioGx6TQmJjTVMandKqr.jJfe99.QckyfH/JJ.OdvLb5/OrCa8ftLr.
shell: /bin/bash
home: /home/kubevirt
lock_passwd: false
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+KMp1F4SrKitvgILf8Q2GQbcOslIg4sfqUOf+m832zwoS2Z2ndmpr/3F+NtLq56cTaEzK9IPBIkNLJfsPqRsToLBYZD+l4S5FfuZ2xwCxGBH+TVXApO+SiD6c84rmjOx47665iQvMHKL+n/5gVvSdYDuegNKnj4rRr/eHnG2yC4TVZl3oHI7TPOUJT+kKjSWP1UesWTZmmck39IaFSmorg31X7g9hJHwq9JEDQilcbnIyqDZKiH6Ju4GjOU8mqhazBFB4qu/QDDb25pDpPd2pQGBilGvm7gwJCVnyDk9YZQU7gYE734KLDf5tCKMmEQSjwFx2Tj9mfZveCIJkaj3T kubevirt
name: cloudinitvolume