From 3934414140b028a51296c886db9f35c2aa0ca098 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 29 Feb 2020 12:30:06 +0000 Subject: [PATCH] initial version of vmhost bundle --- bundles/vmhost/items.py | 5 +++++ bundles/vmhost/metadata.py | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 bundles/vmhost/items.py create mode 100644 bundles/vmhost/metadata.py diff --git a/bundles/vmhost/items.py b/bundles/vmhost/items.py new file mode 100644 index 0000000..564f74f --- /dev/null +++ b/bundles/vmhost/items.py @@ -0,0 +1,5 @@ +pkg_apt = { + 'qemu-kvm': {}, + 'libvirt-clients': {}, + 'libvirt-daemon-system': {}, +} diff --git a/bundles/vmhost/metadata.py b/bundles/vmhost/metadata.py new file mode 100644 index 0000000..cd37846 --- /dev/null +++ b/bundles/vmhost/metadata.py @@ -0,0 +1,11 @@ +@metadata_processor +def add_users_to_libvirt_group(metadata): + if 'users' in metadata: + for user in metadata['users']: + if 'groups' not in metadata['users'][user]: + metadata['users'][user]['groups'] = [] + + if 'libvirt' not in metadata['users'][user]['groups']: + metadata['users'][user]['groups'].append('libvirt') + + return metadata, RUN_ME_AGAIN