Giter Site home page Giter Site logo

ansible-kvm's Introduction

ansible-kvm

An Ansible role to install KVM

Build Status

Build Status

Requirements

Install required Ansible roles:

sudo ansible-galaxy install -r requirements.yml

Role Variables

defaults/main.yml

Dependencies

None

Example Playbook

- hosts: kvm_hosts
  vars: {}
  roles:
    - role: ansible-kvm
  tasks: []

Booting a VM from ISO

You can boot a defined VM up with an ISO by using the following example:

NOTE: Defined in your vars. Also, ensure that the default kvm_manage_vms: false is changed to kvm_manage_vms: true.

kvm_manage_vms: true
kvm_vms:
  - name: test_vm
    autostart: true
    # Define boot devices in order of preference
    boot_devices:
      - cdrom
      - network
      - hd
    cdrom:
      source: /path/to/iso
    graphics: false
    # Define disks in MB
    disks:
      - disk_driver: virtio
        name: test_vm.1
        size: 36864
    memory: 512
    network_interfaces:
      - source: default
        network_driver: virtio
        portgroup: vlan-102
        type: network
    state: running
    vcpu: 1

Example Vars for configure networks

kvm_config_virtual_networks: true kvm_virtual_networks:

  • name: 'default' bridge_name: 'virbr0' mode: 'nat' state: 'active' autostart: 'true' enable_dhcp: true ip: '192.168.122.1' netmask: '255.255.255.0' dhcp_scope_start: '192.168.122.2' dhcp_scope_end: '192.168.122.254'
  • name: 'lan' bridge_name: 'virbr1' mode: 'routed' state: 'active' autostart: 'true' ip: '192.168.0.2' netmask: '255.255.255.0'

License

MIT

Author Information

Larry Smith Jr.

ansible-kvm's People

Contributors

2stacks avatar maurerr avatar mrlesmithjr avatar msaf1980 avatar roedie avatar teebor-choka avatar

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.