GithubHelp home page GithubHelp logo

sar / libvirt_coreos_vm Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nccurry/libvirt_coreos_vm

0.0 1.0 0.0 17 KB

Ansible role to deploy a Fedora CoreOS or Red Hat CoreOS virtual machine into QEMU/KVM

License: MIT License

libvirt_coreos_vm's Introduction

libvirt_coreos_vm

An ansible role to deploy Fedora CoreOS and Red Hat CoreOS virtual machines into QEMU/KVM.

Requirements

This is tested on a host running the following

  • Ansible 2.9.6
  • Fedora 31
  • libvirtd 5.6.0

Role Variables

A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.

Variable Required Default Choices Comments
coreos_type no fedora fedora, redhat Type of CoreOS host to deploy
libvirt_domain_path no ${HOME}/documents/vms Directory path to deploy virtual machine
ignition_path yes Path to ignition 3.0.0 file. One of ignition_config or ignition_path is required.
ignition_config yes YAML definition of the ignition 3.0.0 configuration. One of ignition_config or ignition_path is required.
vm_name no coreos Alphanumeric virtual machine name
vm_mac no 52:54:00:7b:0a:16 QEMU/KVM MAC address
vm_cpus no 2 Number of CPU cores
vm_memory no 2048 Amount of memory in MiB
vm_disk_size no 20G Root disk size in GB. Must end in a single 'G'
vm_network_name no default QEMU/KVM network to deploy domain into
vm_network_bridge no virbr0 Host bridge to put virtual machine interface on
fedora_version no 31 When deploying Fedora CoreOS. Major Fedora version to use for QEMU/KVM libosprofile
fcos_stream no stable Stream to download Fedora CoreOS build from.
fcos_build no 31.20200310.3.0 Fedora CoreOS build number to download
redhat_version no 8.1 When deploying Red Hat CoreOS. Major Red Hat version to use for QEMU/KVM libosprofile
rhcos_build no 4.3.8 Red Hat CoreOS build number to download

Example Playbook

#!/usr/bin/env ansible-playbook
---
- name: Administer virtual machine
  hosts: localhost
  gather_facts: false
  tasks:
  - name: Deploy Fedora CoreOS virtual machine
    vars:
      coreos_type: fedora
      ignition_config:
        ignition:
          version: 3.0.0
        storage:
          files:
          - path: /etc/sysctl.d/11-lowports.conf
            contents:
              source: "data:,net.ipv4.ip_unprivileged_port_start=53"
        systemd:
          units:
          - name: coredns.service
            enabled: true
            contents: "{{ lookup('file', playbook_dir + '/../files/coredns.service') | replace('\n', '\\n') }}"
        passwd:
          users:
          - name: core
            sshAuthorizedKeys:
            - "{{ lookup('file', '/tmp/fcos.pub') }}"
      vm_name: coredns
      vm_mac: 52:54:00:7b:0a:17
      vm_cpus: 2
      vm_memory: 2048
      vm_disk_size: 20G
      vm_network_name: lab
      vm_network_bridge: virbr2
    import_role: 
      name: libvirt_coreos_vm

  - name: Deploy Red Hat CoreOS virtual machine
    vars:
      coreos_type: redhat
      ignition_path: /tmp/openshift/master.ign
      vm_name: ocp-master-1
      vm_mac: 52:54:00:7b:0a:16
      vm_cpus: 4
      vm_memory: 16938
      vm_disk_size: 120G
      vm_network_name: openshift
      vm_network_bridge: virbr0
    import_role: 
      name: libvirt_coreos_vm
...

License

See LICENSE

libvirt_coreos_vm's People

Contributors

nccurry 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.