summaryrefslogtreecommitdiff
path: root/common/vm-install.yml
diff options
context:
space:
mode:
Diffstat (limited to 'common/vm-install.yml')
-rw-r--r--common/vm-install.yml16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/vm-install.yml b/common/vm-install.yml
index fd1dbb20..5d29871b 100644
--- a/common/vm-install.yml
+++ b/common/vm-install.yml
@@ -8,7 +8,21 @@
name: "{{ vm_host }}"
inventory_dir: "{{ inventory_dir }}"
group: _vmhost_
- # TODO: add some sanity checks
+
+ - name: check if the installee belongs to the kvmguests group
+ fail:
+ msg: "the host '{{ hostname }}' does not belong to the group 'kvmguests'"
+ when:
+ - "'kvmguests' not in group_names"
+
+ - name: check if the vm_host belongs to the kvmhosts group
+ fail:
+ msg: "the host '{{ vm_host }}' does not belong to the group 'kvmhosts'"
+ when:
+ - "'kvmhosts' not in hostvars[vm_host].group_names"
+
+ # TODO: add some more sanity checks
+
- name: basic installation
hosts: _vmhost_