# bhyve guests ~~ roles/bhyve/tasks/guest.yml # bhyve guest configuration --- - name: check vm directory stat: path: "{{ bhyve_dir }}/{{ guest.name }}" register: result - name: create all disks for guest shell: vm create -s "{{ guest.disks[0].size }}" "{{ guest.name }}" when: result.stat.isdir is not defined - name: generate guest configuration template: src: "templates/{{ guest.image }}.conf.j2" dest: "{{ bhyve_dir}}/{{ guest.name }}/{{ guest.name }}.conf" vars: guest_cpu: "{{ guest.cpu }}" guest_memory: "{{ guest.memory }}" guest_switch: "{{ hypervisor.switch }}" guest_disks: "{{ guest.disks }}"