diff options
Diffstat (limited to 'roles/bhyve/tasks/guest.yml')
-rw-r--r-- | roles/bhyve/tasks/guest.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/roles/bhyve/tasks/guest.yml b/roles/bhyve/tasks/guest.yml new file mode 100644 index 0000000..9cabf90 --- /dev/null +++ b/roles/bhyve/tasks/guest.yml @@ -0,0 +1,23 @@ + +# bhyve guests ~~ roles/bhyve/tasks/guest.yml +# bhyve guest configuration + +--- + +- name: check kvm directory + stat: path="/data/bhyve/{{ guest.name }}" + register: st + +- name: create all vm bound with current host + shell: vm create -s "{{ guest.disks[0].size }}" "{{ guest.name }}" + when: st.stat.isdir is not defined + +- name: create guest configuration + template: + src: "templates/{{ guest.image }}.conf.j2" + dest: "/data/bhyve/{{ guest.name }}/{{ guest.name }}.conf" + vars: + guest_cpu: "{{ guest.cpu }}" + guest_memory: "{{ guest.memory }}" + guest_switch: "{{ hypervisor.switch }}" + guest_disks: "{{ guest.disks }}" |