aboutsummaryrefslogtreecommitdiffstats
path: root/roles/vmm/tasks/generate_vmconf.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/vmm/tasks/generate_vmconf.yml')
-rw-r--r--roles/vmm/tasks/generate_vmconf.yml27
1 files changed, 11 insertions, 16 deletions
diff --git a/roles/vmm/tasks/generate_vmconf.yml b/roles/vmm/tasks/generate_vmconf.yml
index 9f120fd..c4e80d8 100644
--- a/roles/vmm/tasks/generate_vmconf.yml
+++ b/roles/vmm/tasks/generate_vmconf.yml
@@ -1,29 +1,24 @@
# vmm ~~ tasks/generate_vmconf.yml
+# Generate vm.conf on hypervisor.
---
+- name: Create network switch
+ template:
+ src: templates/hostname.j2
+ dest: "/etc/hostname.{{ vmm.switch.interface }}"
+
+- name: Start network switch
+ shell: "sh /etc/netstart {{ vmm.switch.interface }}"
+
- name: Generate vmm configuration
template:
src: templates/vm.conf.j2
- dest: "{{ vmm.config.file }}"
-
-- name: Create empty disk
- file:
- path: "{{ vmm.disk.dir }}/{{ hostvars[item].ansible_host }}.{{ vmm.disk.format }}"
- state: touch
- loop: "{{ vm.hosts }}"
+ dest: "{{ vmm.config_file }}"
-- name: Restart and enable vmd
+- name: Restart vmd
service:
name: vmd
state: restarted
enabled: true
- when: vm.enabled
-
-- name: Stop and disable vmd
- service:
- name: vmd
- state: stopped
- enabled: false
- when: not vm.enabled
remember that computers suck.