-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvm-playbook.yml
35 lines (31 loc) · 1016 Bytes
/
vm-playbook.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
---
- name: "VM Creation"
hosts: kvm
gather_facts: yes
remote_user: ramu
become: yes
vars_files:
- guests.yml
tasks:
- name: "start vm"
virt:
name: test-machine
command: list_vms
uri: 'qemu:///system'
register: list_vms
- debug: var=list_vms
# - name: create vm
# command: virt-install -n {{item.name}}
# -r {{ item.mem }}
# --vcpus {{ item.cpu }}
# --location {{ item.url }}
# --os-type {{ item.os.type }}
# --os-variant {{ item.os.variant }}
# --network network=virbr0
# --graphics vnc
# --{{item.virt_hypervisor}}
# --virt-type {{ item.virt_type }}
# --disk size={{item.disk.size}},path={{item.disk.path}}/{{item.name}}.img
# --noautoconsole
# when: item.name not in virt_vms.list_vms
# with_items: guests