diff options
Diffstat (limited to 'src/spec.rs')
-rw-r--r-- | src/spec.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/spec.rs b/src/spec.rs index d01abcf..928628e 100644 --- a/src/spec.rs +++ b/src/spec.rs @@ -26,6 +26,8 @@ struct OneVmInputSpecification { pub image_size_gib: Option<u64>, pub memory_mib: Option<u64>, pub cpus: Option<u64>, + pub generate_host_certificate: Option<bool>, + pub ca_key: Option<PathBuf>, } impl OneVmInputSpecification { @@ -131,6 +133,8 @@ pub struct Specification { pub image_size_gib: u64, pub memory_mib: u64, pub cpus: u64, + pub generate_host_certificate: bool, + pub ca_key: Option<PathBuf>, } #[derive(Debug, thiserror::Error)] @@ -193,6 +197,11 @@ impl Specification { ) -> Result<Specification, SpecificationError> { let key_filenames = input.ssh_key_files(config, name)?; let ssh_keys = ssh_keys(&key_filenames)?; + let ca_key = if let Some(filename) = &input.ca_key { + Some(filename.clone()) + } else { + config.ca_key.clone() + }; let spec = Specification { name: name.to_string(), @@ -210,6 +219,8 @@ impl Specification { image_size_gib: input.image_size_gib(config, name)?, memory_mib: input.memory_mib(config, name)?, cpus: input.cpus(config, name)?, + generate_host_certificate: input.generate_host_certificate.or(Some(false)).unwrap(), + ca_key: ca_key, }; debug!("specification as with defaults applied: {:#?}", spec); |