bundles/vmhost: add metadata reactor to add all admins to 'libvirt' group
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-08-22 07:25:46 +02:00
parent 65462ca536
commit 3f38497585
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 18 additions and 12 deletions

View file

@ -35,3 +35,21 @@ if node.has_bundle('nftables'):
'pkg_apt:libvirt-daemon-system', 'pkg_apt:libvirt-daemon-system',
}, },
} }
@metadata_reactor.provides(
'users',
)
def libvirt_group_for_admins(metadata):
result = {}
for user, config in metadata.get('users', {}).items():
if config.get('is_admin', False):
result[user] = {
'groups': {
'libvirt',
},
}
return {
'users': result,
}

View file

@ -185,13 +185,11 @@ nodes['home.nas'] = {
}, },
'kunsi': { 'kunsi': {
'groups': { 'groups': {
'libvirt',
'nas', 'nas',
}, },
}, },
'sophie': { 'sophie': {
'groups': { 'groups': {
'libvirt',
'nas', 'nas',
}, },
}, },

View file

@ -72,13 +72,6 @@ nodes['htz.ex42-1048908'] = {
'/dev/nvme1', '/dev/nvme1',
}, },
}, },
'users': {
'kunsi': {
'groups': [
'libvirt',
],
},
},
'vm': { 'vm': {
'cpu': 8, 'cpu': 8,
'ram': 64, 'ram': 64,

View file

@ -496,9 +496,6 @@ nodes['rx300'] = {
'users': { 'users': {
'kunsi': { 'kunsi': {
'enable_linger': True, 'enable_linger': True,
'groups': {
'libvirt',
},
}, },
}, },
'zfs': { 'zfs': {