mirror of
https://codeberg.org/spire/dispenser.git
synced 2026-06-03 18:14:06 +02:00
add option to add ssh key to the server
This commit is contained in:
parent
7956df6dfd
commit
58d593790a
5 changed files with 87 additions and 3 deletions
|
|
@ -187,7 +187,14 @@ async fn start(cloud: &dyn Cloud, config: &Config) -> Result<String, Error> {
|
|||
if !list.is_empty() {
|
||||
return Err(Error::AlreadyRunning);
|
||||
}
|
||||
let created = cloud.spawn().await?;
|
||||
|
||||
let ssh_key = if let Some(key) = config.server.ssh_key.as_ref() {
|
||||
Some(cloud.get_ssh_key_id(key).await?)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let created = cloud.spawn(ssh_key.as_deref()).await?;
|
||||
let server = cloud.wait_for_ip(&created.id).await?;
|
||||
|
||||
println!("Server is booting");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue