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