mirror of
https://github.com/Smaug123/PulumiConfig
synced 2025-10-08 10:08:40 +00:00
Create Pulumi-provisioned web server
This commit is contained in:
19
PulumiWebServer/Local.fs
Normal file
19
PulumiWebServer/Local.fs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace PulumiWebServer
|
||||
|
||||
open System.Diagnostics
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
module Local =
|
||||
let forgetKey (address : Address) : unit =
|
||||
let address = address.Get ()
|
||||
let psi = ProcessStartInfo "/usr/bin/ssh-keygen"
|
||||
psi.Arguments <- $"-R {address}"
|
||||
psi.RedirectStandardError <- true
|
||||
psi.RedirectStandardOutput <- true
|
||||
psi.UseShellExecute <- false
|
||||
let proc = psi |> Process.Start
|
||||
proc.WaitForExit ()
|
||||
let error = proc.StandardOutput.ReadToEnd ()
|
||||
// We don't expect to have configured SSH yet, so this is fine.
|
||||
if proc.ExitCode <> 0 then
|
||||
failwith $"Unexpectedly failed to forget key: {address} ({proc.ExitCode}). {error}"
|
Reference in New Issue
Block a user