blob: b24b4340de0ea398d750d21517259892b89519ee (
plain) (
tree)
|
|
# bhyve guests ~~ roles/bhyve/tasks/guest.yml
# bhyve guest configuration
---
- name: check vm directory
stat: path="/data/bhyve/{{ guest.name }}"
register: st
- name: create all disks 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 }}"
|