vm-setup/create-vm.yml
2022-06-16 20:43:06 +02:00

29 lines
611 B
YAML

##
# This playbook creates a vm from a cloud image, using ansible and libvirt.
#
# It is mainly forked from here: https://github.com/SkullTech/scripts/blob/master/create-vm.yml
#
##
---
- name: Create a VM using a cloud image
hosts: twice
vars_prompt:
- name: vmname
prompt: Name of the VM
private: no
- name: image_capacity
prompt: Disk capacity
private: no
default: 10G
- name: ram
prompt: "RAM"
private: no
default: 2048
- name: vcpus
prompt: Num. of CPUs
private: no
default: 1
become: false
roles:
- create-vm