engine: resources: Add simple configuration steps to virt builder

This adds some simplistic configuration management / provisioning
functionality to this virt:builder resource which makes it easier to
kick off special functionality that we might want to build.
This commit is contained in:
James Shubin
2025-03-11 00:50:02 -04:00
parent 219d25b330
commit 46035fee83
2 changed files with 168 additions and 0 deletions

View File

@@ -99,6 +99,11 @@ class vm($name, $config) {
}
$seeds = $config->seeds || []
$mkdir = $config->mkdir || []
$copy_in = $config->copy_in || []
$run_cmd = $config->run_cmd || []
$firstboot_cmd = $config->firstboot_cmd || []
virt:builder "${filename}" {
hostname => $name,
os_version => "${distro}-${version}",
@@ -118,6 +123,11 @@ class vm($name, $config) {
root_password_selector => $root_password_selector,
seeds => $seeds,
mkdir => $mkdir,
copy_in => $copy_in,
run_cmd => $run_cmd,
firstboot_cmd => $firstboot_cmd,
# make sure key exists so that's it's available for injection!
Depend => File["/root/.ssh/id_rsa"],
Depend => Svc["virtqemud"],