aboutsummaryrefslogtreecommitdiffstats
path: root/roles/bhyve/tasks/guest.yml
blob: 9cabf9028b53d6707c8a8002f3ccae361a07a03f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

# bhyve guests ~~ roles/bhyve/tasks/guest.yml
# bhyve guest configuration

---

- name: check kvm directory
  stat: path="/data/bhyve/{{ guest.name }}"
  register: st

- name: create all vm 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 }}"
remember that computers suck.