summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2022-01-01 17:13:26 +0100
committerChristian Pointner <equinox@spreadspace.org>2022-01-02 23:26:17 +0100
commita9c5560dcca18a0df93341289087a9585fbca29c (patch)
treebe284c40faea1e61f8304e49dcc7a9d0788be193 /common
parentminor cleanup for grafana dashboards (diff)
add new openwrt-based testvm
add new vm-deploy playbook and script
Diffstat (limited to 'common')
-rw-r--r--common/vm-deploy.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/common/vm-deploy.yml b/common/vm-deploy.yml
new file mode 100644
index 00000000..e7c9ded7
--- /dev/null
+++ b/common/vm-deploy.yml
@@ -0,0 +1,32 @@
+---
+- 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: fetch infos from image file
+ stat:
+ path: "{{ output_images | first }}"
+ get_mime: yes
+ register: output_images_info
+
+ - debug:
+ var: output_images_info.stat