diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-05-03 20:31:44 +0200 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-05-03 20:31:44 +0200 |
commit | 800a8e329f0717fd202cb4ec369be1438cab2729 (patch) | |
tree | d6a2c55fb42b58bfc7bad22d7b0dba5cfc492843 /roles | |
parent | 11fbaf0b558400264c95026c70ed938a97f1673d (diff) | |
download | infrastructure-800a8e329f0717fd202cb4ec369be1438cab2729.tar.gz |
roles/bhyve: Use bhyve_dir
Diffstat (limited to 'roles')
-rw-r--r-- | roles/bhyve/tasks/guest.yml | 13 |
1 files changed, 7 insertions, 6 deletions
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 }}" |