Cross platform automated patch management
-
So I told @fuznutz04 the other night I'd send him my Ansible role that creates KVM guests and I completely forgot. Here's a link to what I wrote: https://hooks.technology/2017/10/create-vms-on-kvm-with-ansible/
There is also a library that Larry Smith wrote. Here's a link to the PR https://github.com/ansible/ansible/pull/39340. I just copied what he wrote and put it in my libraries folder so I can use it as a custom module. This module will actually clone a template for you. Here's his example:
--- - hosts: kvm vars: vm_template: ubuntu1604-packer-template vms: - name: app01 state: started template: "{{ vm_template }}" - name: db01 state: started template: "{{ vm_template }}" - name: lb01 state: started template: "{{ vm_template }}" - name: web01 state: started template: "{{ vm_template }}" tasks: - name: Cloning VMs virt_clone: name: "{{ item['name'] }}" state: "{{ item['state'] }}" template: "{{ item['template'] }}" uuid: "{{ item['uuid']|default(omit) }}" become: true loop: "{{ vms }}"
Sorry it took so long to get this out there.
-
This is the provider I use to clone KVM guests with Terraform https://github.com/dmacvicar/terraform-provider-libvirt