aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/vmm/files/init_vm_alpine.py (renamed from roles/vmm/files/init_vm_alpine.yml)0
-rw-r--r--roles/vmm/tasks/main.yml12
-rw-r--r--roles/vmm/tasks/set_facts.yml5
3 files changed, 16 insertions, 1 deletions
diff --git a/roles/vmm/files/init_vm_alpine.yml b/roles/vmm/files/init_vm_alpine.py
index d9dc0d5..d9dc0d5 100644
--- a/roles/vmm/files/init_vm_alpine.yml
+++ b/roles/vmm/files/init_vm_alpine.py
diff --git a/roles/vmm/tasks/main.yml b/roles/vmm/tasks/main.yml
index 9011497..81ddafc 100644
--- a/roles/vmm/tasks/main.yml
+++ b/roles/vmm/tasks/main.yml
@@ -3,6 +3,18 @@
---
+- name: Check that iso directory exists
+ file:
+ path: "{{ vmm.iso_dir }}"
+ state: directory
+ recurse: true
+
+- name: Check that disk directory exists
+ file:
+ path: "{{ vmm.disk_dir }}"
+ state: directory
+ recurse: true
+
- name: Download all iso files
include: download_iso.yml iso={{ item }}
with_items: "{{ vmm.iso }}"
diff --git a/roles/vmm/tasks/set_facts.yml b/roles/vmm/tasks/set_facts.yml
index 5263d06..a38a63d 100644
--- a/roles/vmm/tasks/set_facts.yml
+++ b/roles/vmm/tasks/set_facts.yml
@@ -4,11 +4,14 @@
---
- set_fact:
+ disk_file: "{{ vmm.disk_dir }}/{{ guest }}.{{ vmm.disk_format }}"
+ when: guest is defined
+
+- set_fact:
iso_latest: "{{ vmm.iso_dir }}/{{ vmm.iso[iso].name }}-latest.iso"
when: iso is defined
- set_fact:
- disk_file: "{{ vmm.disk_dir }}/{{ guest }}.{{ vmm.disk_format }}"
iso_file: "{{ iso_latest | regex_replace('latest', vmm.iso[iso].version) }}"
iso_url: "{{ vmm.iso[iso].url \
| regex_replace('VERSIONDIR', vmm.iso[iso].versiondir) \
remember that computers suck.