From 79d662045cba5c0c424f884e6de2ba11d90c530d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 5 Jul 2019 19:50:27 +0200 Subject: bugfixes and cleanup of vm/install --- common/vm-install.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'common') 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_ -- cgit v1.2.3