aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-07 21:42:58 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-08 17:52:51 +0000
commit56aa88c7e272ccfd645695103d5bca653005aad4 (patch)
tree757e44da79e5d6cf8c9f572ef6c426d91fb169c6 /roles/vmm/tasks
parentee9a624949497a4a3944b24e1b3d9c192dd3d444 (diff)
downloadrules-56aa88c7e272ccfd645695103d5bca653005aad4.tar.gz
roles/vmm: Use host kernels for openbsd guests
Diffstat (limited to 'roles/vmm/tasks')
-rw-r--r--roles/vmm/tasks/autoinstall_configuration.yml (renamed from roles/vmm/tasks/autoinstall-configuration.yml)22
-rw-r--r--roles/vmm/tasks/facts.yml8
-rw-r--r--roles/vmm/tasks/main.yml2
3 files changed, 25 insertions, 7 deletions
diff --git a/roles/vmm/tasks/autoinstall-configuration.yml b/roles/vmm/tasks/autoinstall_configuration.yml
index e05b11c..cd52a84 100644
--- a/roles/vmm/tasks/autoinstall-configuration.yml
+++ b/roles/vmm/tasks/autoinstall_configuration.yml
@@ -10,18 +10,36 @@
state: directory
- name: generate autoinstall files
- template:
+ template: &generation_steps
src: autoinstall.conf.j2
dest: "/var/www/htdocs/autoinstall/{{ item.lladdr }}-install.conf"
owner: www
group: www
mode: 0640
+ when: item.image == "openbsd"
+ loop: "{{ vmm_vms }}"
+
+- name: generate autoupgrade files
+ template:
+ <<: *generation_steps
+ dest: "/var/www/htdocs/autoinstall/{{ item.lladdr }}-upgrade.conf"
+ when: item.image == "openbsd"
loop: "{{ vmm_vms }}"
- name: generate httpd configuration
template:
+ <<: *generation_steps
src: httpd.conf.j2
dest: "{{ httpd_configuration_dir }}/autoinstall.conf"
owner: 0
group: 0
- mode: 0640
+
+- name: link openbsd vm kernel to host kernel
+ file:
+ src: /bsd.sp
+ dest: "{{ vmm_image_openbsd_kernel_prefix }}.{{ item.name }}"
+ owner: 0
+ group: 0
+ state: hard
+ when: item.image == "openbsd"
+ loop: "{{ vmm_vms }}"
diff --git a/roles/vmm/tasks/facts.yml b/roles/vmm/tasks/facts.yml
index c7b453b..58a6df5 100644
--- a/roles/vmm/tasks/facts.yml
+++ b/roles/vmm/tasks/facts.yml
@@ -2,10 +2,10 @@
set_fact:
vmm_vms_tmp: >
{{ vmm_vms_tmp | default([]) + [ item | combine({
- 'lladdr': item.name
- | hash('sha1')
- | truncate(12, True, '')
- | ansible.netcommon.hwaddr('unix')
+ "lladdr": item.name
+ | hash("sha1")
+ | truncate(12, True, "")
+ | ansible.netcommon.hwaddr("unix")
}) ] }}
loop: "{{ vmm_vms }}"
diff --git a/roles/vmm/tasks/main.yml b/roles/vmm/tasks/main.yml
index c596664..26580f2 100644
--- a/roles/vmm/tasks/main.yml
+++ b/roles/vmm/tasks/main.yml
@@ -14,7 +14,7 @@
include_tasks: facts.yml
- name: include autoinstall generation
- include_tasks: autoinstall-configuration.yml
+ include_tasks: autoinstall_configuration.yml
tags: task_autoinstall_configuration
- name: include iso management
remember that computers suck.