[Unit] Description=RHDE VM Bootstrap Service Documentation=man:systemd.service(5) After=network-online.target Wants=network-online.target # Only start if the VM root disk does not exist ConditionPathExists=!/var/lib/libvirt/images/%i/root.qcow2 # Only start if the VM definition file is present ConditionPathExists=/etc/default/bootstrap-vm-%i.env # Remain started to avoid race conditions Persistent=true [Service] Type=oneshot ExecStart=/usr/local/bin/bootstrap-vm.sh %i EnvironmentFile=/etc/default/bootstrap-vm-%i.env [Install] WantedBy=multi-user.target