Git Product home page Git Product logo

ansible-role-kvm-cloud-init-vm's Introduction

Ansible Role: Deploy cloud init image on KVM

This role help deploy a new CentOS 7 vm on KVM.

Details

  • Download cloud init Image.
  • Generate cloud init user/meta data and booting iso.
  • Increase root storage size to 20G.
  • Clean up cd-rom/booting iso/user/meta data

Tested Cloud Init Image

  • CentOS

Requirements

None

Role Variables

Name Default value Requird Description
kvm_install_host localhost no The host where KVM install
kvm_vm_pool_dir /var/lib/libvirt/images no The path where KVM VM images are stored
vm_data_dir /root/kvm/vms no The path where VM information are stored
vm_recreate true no Set false, if the same vm exist
cloud_init_vm_image CentOS-7-x86_64-GenericCloud.qcow2 no Cloud init image name
cloud_init_vm_image_link https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1809.qcow2 no Cloud init image download link
cloud_init_user_data {{vm_data_dir}}/{{vm_name}}/user-data no Cloud init user data file
cloud_init_meta_data {{vm_data_dir}}/{{vm_name}}/meta-data no Cloud init meta data file
cloud_init_iso_image {{vm_data_dir}}/{{vm_name}}/cidata.iso no Cloud init booting image
vm_name CentOS_Base no
vm_local_hostname base.example.com no VM internal hostname(it can be the same with vm_hostname)
vm_hostname base.example.com no VM public hostname
vm_public_key {{lookup('file','~/.ssh/id_rsa.pub')}} no SSH public key to login to the VM(ocp/redhat,centos/(ssh))
vm_cpu 2 no
vm_memory 2048 no
vm_network_br virbr0 no Default bridge name that the VM will use
vm_root_disk_size 20G no

Dependencies

None

Example Playbook

- name: Example Playbook
  hosts: localhost
  gather_facts: false
  tasks:
    - import_role:
        name: ansible-role-kvm-cloud-init-vm

License

BSD/MIT

Author Information

This role was created in 2018 by Jooho Lee.

ansible-role-kvm-cloud-init-vm's People

Contributors

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