Git Product home page Git Product logo

ansible-kvm-vm's Introduction

kvm-vm

Create a VM on a RHEL+KVM hypervisor.

Requirements

  • Expects a working RHEL+KVM hypervisor to target
  • Either physical virtualization or nested virtualization

Role Variables

Variable Required Default Description
kvm_vm_hostname ✔️ The FQDN for the VM
kvm_vm_public_ip ✔️ The reachable public IP for the VM
kvm_vm_root_pwd ✔️ Password for the root user of the VM
kvm_vm_base_img ✔️ Name of the base image located in /var/lib/libvirt/images on the KVM hypervisor
kvm_vm_vcpus 1 Number of vCPUS to assign to the VM
kvm_vm_ram 1024 Amount of ram to give to the VM in megabytes
kvm_vm_os_disk_name {{ kvm_vm_hostname }} Name of the OS disk in /var/lib/libvirt/images
kvm_vm_os_disk_size 10G Size of OS disk for the VM
kvm_vm_nics ✔️ see example playbook Dictionary of NICs to create for the VM

Dependencies

None

Example Playbook

- hosts: kvm
  tags: provision
  vars:
    kvm_vm_hostname: "vm1.example.com"
    kvm_vm_public_ip: 192.168.122.10
    kvm_vm_root_pwd: "p@ssw0rd"
    kvm_vm_base_img: rhel-guest-image-7.qcow2
    kvm_vm_vcpus: "2"
    kvm_vm_ram: "4096"
    kvm_vm_os_disk_name: "{{ kvm_vm_hostname }}"
    kvm_vm_os_disk_size: "10G"
    kvm_vm_nics:
      - name: eth0
        bootproto: static
        onboot: yes
        ip: "{{ kvm_vm_public_ip }}"
        prefix: "24"
        gateway: "192.168.122.1"
        dns_server: "192.168.122.1"
        config: "--type network --source default --model virtio"
  tasks:
    - name: Create KVM VM
      include_role:
        name: RedHatGov.kvm-vm

License

GPLv3

Author Information

Red Hat North American Public Sector Solution Architects

ansible-kvm-vm's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.