ansible-kvm-provision/kvm_provision.yaml

26 lines
601 B
YAML
Raw Permalink Normal View History

2022-03-08 19:55:15 +01:00
- name: Deploys VM based on cloud image
hosts: localhost
gather_facts: yes
#become: yes
vars:
pool_dir: "/home/user/kvm"
vm: vm_name
vcpus: 1
ram_mb: 512
cleanup: no
net: default
ssh_pub_key: "/home/user/.ssh/id_ed25519.pub"
tasks:
- name: KVM Provision role
include_role:
name: kvm_provision
vars:
libvirt_pool_dir: "{{ pool_dir }}"
vm_name: "{{ vm }}"
vm_vcpus: "{{ vcpus }}"
vm_ram_mb: "{{ ram_mb }}"
vm_net: "{{ net }}"
cleanup_tmp: "{{ cleanup }}"
ssh_key: "{{ ssh_pub_key }}"