Skip to content

Instantly share code, notes, and snippets.

@kmurudi
Created March 17, 2018 03:47
Show Gist options
  • Save kmurudi/25a6aca319db141de18becd16698d274 to your computer and use it in GitHub Desktop.
Save kmurudi/25a6aca319db141de18becd16698d274 to your computer and use it in GitHub Desktop.
- hosts: localhost
gather_facts: no
## Package installations
tasks:
- name: Check for qemu-kvm
apt:
name: qemu-kvm
state: present
- name: Check for libvirt packages and ovs
apt:
name: "{{ item }}"
state: present
with_items:
- libvirt-bin
- virt-manager
- virt-viewer
- virtinst
- name: Downloading cent OS iso image
get_url:
url: http://mirror.hostduplex.com/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso
dest: /home/kmurudi/CentOS.iso
- name: Creating VM
command: virt-install -n kmurudiVM1 -r 2048 --vcpu=2 --cpu host --disk path=/var/lib/libvirt/images/kmurudiVM1.img,size=12 --network network=net1 --network network=net2 -c /home/kmurudi/CentOS.iso -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment