aboutsummaryrefslogtreecommitdiffstats
path: root/roles/bhyve/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/bhyve/tasks/main.yml')
-rw-r--r--roles/bhyve/tasks/main.yml9
1 files changed, 4 insertions, 5 deletions
diff --git a/roles/bhyve/tasks/main.yml b/roles/bhyve/tasks/main.yml
index 03d2d96..f47be53 100644
--- a/roles/bhyve/tasks/main.yml
+++ b/roles/bhyve/tasks/main.yml
@@ -68,18 +68,17 @@
dest: "{{ bhyve_dir }}/.iso"
loop: "{{ bhyve_iso }}"
-- name: retrieve all deprecated vms
+- name: retrieve all active vms
find:
path: "{{ bhyve_dir }}"
file_type: directory
- register: deprecated_vms
+ register: active_vms
- name: delete all deprecated vms
file:
path: "{{ item[1].path }}"
state: absent
- when: (item[1].path | basename) not in "{{ valid_vms }}"
+ when: bhyve_strict and (item[1].path | basename) not in "{{ valid_vms }}"
with_nested:
- "{{ vms }}"
- - "{{ deprecated_vms.files }}"
-
+ - "{{ active_vms.files }}"
remember that computers suck.