aboutsummaryrefslogtreecommitdiffstats
path: root/roles/bhyve/tasks
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-05-03 20:31:44 +0200
committerRomain Gonçalves <me@rgoncalves.se>2021-05-03 20:31:44 +0200
commit800a8e329f0717fd202cb4ec369be1438cab2729 (patch)
treed6a2c55fb42b58bfc7bad22d7b0dba5cfc492843 /roles/bhyve/tasks
parent11fbaf0b558400264c95026c70ed938a97f1673d (diff)
downloadinfrastructure-800a8e329f0717fd202cb4ec369be1438cab2729.tar.gz
roles/bhyve: Use bhyve_dir
Diffstat (limited to 'roles/bhyve/tasks')
-rw-r--r--roles/bhyve/tasks/guest.yml13
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 }}"
remember that computers suck.