install.fairie/home/.chezmoiscripts/qubes/run_onchange_before_14-ensure-minimal-vms-passwordless.tmpl

16 lines
727 B
Cheetah
Raw Normal View History

#!/usr/bin/env bash
### Ensure Qubes minimal templates have passwordless sudo
for TEMPLATE of {{ .qubes.templates | toString | replace "[" "" | replace "]" "" }}; do
if [[ "$TEMPLATE" == *'-minimal' ]]; then
if [[ "$TEMPLATE" == 'debian'* ]] || [[ "$TEMPLATE" == 'ubuntu'* ]]; then
logg info "Installing qubes-core-agent-passwordless-root on $TEMPLATE"
qvm-run -u root "$TEMPLATE" apt-get update
qvm-run -u root "$TEMPLATE" apt-get install -y qubes-core-agent-passwordless-root
elif [[ "$TEMPLATE" == 'fedora'* ]]; then
logg info "Installing qubes-core-agent-passwordless-root on $TEMPLATE"
qvm-run -u root "$TEMPLATE" dnf install -y qubes-core-agent-passwordless-root
fi
fi
done