From 800a8e329f0717fd202cb4ec369be1438cab2729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 3 May 2021 20:31:44 +0200 Subject: roles/bhyve: Use bhyve_dir --- roles/bhyve/tasks/guest.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'roles') diff --git a/roles/bhyve/tasks/guest.yml b/roles/bhyve/tasks/guest.yml index b24b434..e88e511 100644 --- a/roles/bhyve/tasks/guest.yml +++ b/roles/bhyve/tasks/guest.yml @@ -5,17 +5,18 @@ --- - name: check vm directory - stat: path="/data/bhyve/{{ guest.name }}" - register: st + stat: + path: "{{ bhyve_dir }}/{{ guest.name }}" + register: result -- name: create all disks bound with current host +- name: create all disks for guest shell: vm create -s "{{ guest.disks[0].size }}" "{{ guest.name }}" - when: st.stat.isdir is not defined + when: result.stat.isdir is not defined -- name: create guest configuration +- name: generate guest configuration template: src: "templates/{{ guest.image }}.conf.j2" - dest: "/data/bhyve/{{ guest.name }}/{{ guest.name }}.conf" + dest: "{{ bhyve_dir}}/{{ guest.name }}/{{ guest.name }}.conf" vars: guest_cpu: "{{ guest.cpu }}" guest_memory: "{{ guest.memory }}" -- cgit v1.2.3