All Projects → noahbailey → ansible-qemu-kvm

noahbailey / ansible-qemu-kvm

Licence: GPL-3.0 license
Ansible role to provision KVM/QEMU virtual machines

Programming Languages

HTML
75241 projects

Projects that are alternatives of or similar to ansible-qemu-kvm

UBUNTU20-CIS
Ansible role for Ubuntu 2004 CIS Baseline
Stars: ✭ 136 (+257.89%)
Mutual labels:  ansible-role
ansible-role-cardano-node
Ansible role for the provisioning of Shelly Cardano binaries from source.
Stars: ✭ 20 (-47.37%)
Mutual labels:  ansible-role
ansible-role-systemd-service
No description or website provided.
Stars: ✭ 37 (-2.63%)
Mutual labels:  ansible-role
kafka role
Ansible role to install Apache Kafka
Stars: ✭ 18 (-52.63%)
Mutual labels:  ansible-role
RHEL8-STIG
Ansible role for Red Hat 8 STIG Baseline
Stars: ✭ 73 (+92.11%)
Mutual labels:  ansible-role
PrometheusWithGrafana
Setup Prometheus with Grafana dashboard using Ansible
Stars: ✭ 50 (+31.58%)
Mutual labels:  ansible-role
Ansible Playbook Grapher
A command line tool to create a graph representing your Ansible playbook tasks and roles
Stars: ✭ 234 (+515.79%)
Mutual labels:  ansible-role
ansible-role-aptly
Install aptly debian respository manager and enable the REST API
Stars: ✭ 37 (-2.63%)
Mutual labels:  ansible-role
ansible-role-github-users
Ansible Role - GitHub Users
Stars: ✭ 49 (+28.95%)
Mutual labels:  ansible-role
ansible-backup
Ansible daily backup role
Stars: ✭ 25 (-34.21%)
Mutual labels:  ansible-role
ansible-role-virtualbox
Ansible Role - Installs headless Virtualbox and phpVirtualbox for remote access through Web GUI
Stars: ✭ 14 (-63.16%)
Mutual labels:  ansible-role
ansible-cloudflared
Install cloudflared and systemd service for DNS-Over-HTTPS
Stars: ✭ 18 (-52.63%)
Mutual labels:  ansible-role
consul role
Ansible role to install Consul (cluster of) server/agent
Stars: ✭ 14 (-63.16%)
Mutual labels:  ansible-role
ansible-role-tailscale
Ansible role to install and configure a Tailscale node.
Stars: ✭ 189 (+397.37%)
Mutual labels:  ansible-role
Complete-Single-GPU-Passthrough
Single GPU VFIO Passthrough Guide
Stars: ✭ 385 (+913.16%)
Mutual labels:  qemu-kvm
Rvm1 Ansible
The official ansible RVM role to install and manage your Ruby versions.
Stars: ✭ 246 (+547.37%)
Mutual labels:  ansible-role
ansible-resolv
Ansible role to configure /etc/resolv.conf
Stars: ✭ 44 (+15.79%)
Mutual labels:  ansible-role
ansible-role-harden-linux
Ansible role for hardening Linux
Stars: ✭ 99 (+160.53%)
Mutual labels:  ansible-role
monit
Ansible role that configures monit. Will also setup baseline monitoring of SSH, NTP, and Cron.
Stars: ✭ 37 (-2.63%)
Mutual labels:  ansible-role
ansible-role-auditbeat
Ansible role to install auditbeat for security monitoring. (Ruleset included)
Stars: ✭ 15 (-60.53%)
Mutual labels:  ansible-role

ansible-qemu-kvm

Ansible role to provision virtual machines using the QEMU and KVM systems.

Think of it like OpenStack for poor people.

Currently, this role only creates virtual machines running the lite version of Ubuntu 18.04. Future versions may expand on this, but it is the primary server operating system that I use.

Usage

Add this role to the roles directory in your ansible project.

Then, include the role using a top level playbook:

- name: KVM hosts 
  hosts: kvm-hosts
  become: true 
  roles: 
    - ansible-qemu-kvm

Variables

This role requires these variables to exist in inventory:

1. Users

users: 
- name: ongo
  full_name: Ongo Gablogian 
  passwd: $6$rounds=2048$aaaaaaaa
  pub_key: ssh-rsa AAAAB3N [email protected]

This is a list of users that should be added to the server during provisioning.

The passwd and pub_key parameters take your hashed password and your SSH public key so that you are able to access the server after provisioning.

To generate a new password hash, use mkpasswd -m sha-512 -R 2048 (Included in the whois package).

2. VMs

virtual_machines: 
- name: u18-svr-001
  cpu: 1
  mem: 1024
  disk: 10G
  bridge: br10 

This is a list of virtual machines that should be built.

Bridge: this is the name of the bridge device that references the vlan the server will be connected to. This must already exist on the KVM host.

The virtual machine can also be built with a static IP address:

- name: u18-svr-002
  cpu: 1
  mem: 512 
  disk: 5G
  bridge: br10 
  net: 
    ip: 10.11.12.13/24
    gateway: 10.11.12.1 
    domain: gablogianartcollection.org
    dns: 
      - 1.1.1.1
      - 9.9.9.9

This variable takes exactly one IP address, domain, and gateway; and two or more DNS servers.

Default Values

If no value is supplied, the default settings will be used:

  • CPU: 1 core
  • Memory: 512 MB
  • Disk: 5GB .qcow image
  • Bridge: Default libvirt NAT network
  • Network: DHCP

How it works

This role works by downloading the Ubuntu 18.04 cloud image, then converting it to Copy-On-Write format and cloning it for each virtual machine defined.

When VMs are launched, they are given a small secondary disk image that includes a cloud-config file. This file is generated from a template that includes all the users and system parameters that are defined in inventory. There is also a network-config file that contains network metadata in Netplan-V2 format.

Before running this, ensure that networking is correctly configured on the KVM hosts.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].