-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew-vm.yml
25 lines (23 loc) · 1.01 KB
/
new-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
---
- hosts: all
gather_facts: no
sudo: true
tasks:
- name: get list of vms
virt: command=list_vms
register: virt_vms
- name: create vm
command: virt-install -n {{ vm_hostname }}
-r {{ vm_mem }}
--vcpus {{ vm_cpus }}
--location {{ vm_install_loc }}
--os-type {{ vm_ostype }}
--os-variant {{ vm_osvariant }}
--network bridge=bvm1
--graphics none
--console pty,target_type=serial
--disk /srv/vm-images/{{vm_hostname}}-disk1,size={{vm_disksize}}
--noautoconsole
--extra-args 'ks={{vm_ksurl}} console=ttyS0,115200n8 serial ip={{vm_ipaddr}} netmask=255.255.255.224 gateway=109.95.186.61 dns=8.8.8.8'
#when: item.name not in virt_vms.list_vms
#with_items: guests