Giter VIP home page Giter VIP logo

ansible-virsh's Introduction

Ansible Role - virsh

VM Deployment using virsh

Available on Ansible Galaxy: pgkehle.virsh

Variables

deploy_dir: Required for where the base path lives

Tags

tags:
- install
- rename
- create
- storage

Examples

Example to install the packages

- hosts: all

  vars:
    flags:      ['install']

  roles:
    - { role: pgkehle.virsh }

Example to create a vm

- hosts: all

  vars:
    flags:          ['create']
    vm_name: 'vm_name'
    vm_cfg:
      storage:
        primary:
          size: 320G
          type: xfs
          name: vda
        secondary:
          size: 3T
          type: xfs
          name: vdb
      vcpus: 4
      memory:
        size: 4096
      graphics:
        vnc:
          port: 5900
      network:
        do_proxy: true            # Enable proxy settings for the new VM. Ensure proxy config is included.
        dchp: true                # Whether to use DHCP
        # Required when not using DHCP
        ip: xx.xx.xx.xx           # IP Address to use
        mask: x                   # Network Mask Value
        gateway: xx.xx.xx.xx      # Network Gateway
        netmask: xx.xx.xx.xx      # Netmask
        broadcast: xx.xx.xx.xx    # Broadcast address
        mac: xxx.xxx.xxx.xxx      # MAC Address
    proxy:
      addr: "address.com"
      port: "3128"


  roles:
    - { role: pgkehle.virsh }

Example to rename a vm

- hosts: all

  vars:
    flags:  ['rename']
    vm_name: 'vm_name'
    vm_old: 'old_vm'

  roles:
    - { role: pgkehle.virsh }

Example add secondary storage

- hosts: all

  vars:
    flags:              ['secondary_storage']
    vm_name: 'vm_name'
    vm_cfg:
      storage:
        primary:
          size: 320G
          type: xfs
          name: vda
        secondary:
          size: 3T
          type: xfs
          name: vdb
    base_image_path:   '/mnt/storage/'

  roles:
    - { role: pgkehle.virsh }

Linting

yamllint -c yamllint.yaml .
ansible-lint .

License

MIT

Author Information

Paul Kehle
@pgkehle (twitter, github, linkedin)

ansible-virsh'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.