diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-01-04 14:39:23 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-01-04 14:39:23 +0100 |
commit | c3df634ef65332b68a509c4651a0eb8657642321 (patch) | |
tree | a8555a07e1490f15cbd0b09f03f2f0c9d956f135 /common | |
parent | sensor: i2c bus detection using regex for name (diff) | |
parent | add some todo docs (diff) |
Merge branch 'topic/openwrt-vm'
Diffstat (limited to 'common')
-rw-r--r-- | common/vm-deploy.yml | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/common/vm-deploy.yml b/common/vm-deploy.yml new file mode 100644 index 00000000..bc2e8039 --- /dev/null +++ b/common/vm-deploy.yml @@ -0,0 +1,30 @@ +--- +- name: preparations and sanity checks + hosts: "{{ install_hostname }}" + connection: local + gather_facts: no + tasks: + - name: check if the installee belongs to the kvmguests group + fail: + msg: "the host '{{ install_hostname }}' does not belong to the group 'kvmguests'" + when: + - "'kvmguests' not in group_names" + + - name: check if the host system belongs to the kvmhosts group + fail: + msg: "the host '{{ vm_host.name }}' does not belong to the group 'kvmhosts'" + when: + - "'kvmhosts' not in hostvars[vm_host.name].group_names" + + - name: check if there is only one output image + fail: + msg: "the output_images variable must only contain a single image" + when: + - (output_images | length) != 1 + + +- name: deploy vm + hosts: "{{ install_hostname }}" + gather_facts: no + roles: + - role: vm/guest/deploy |