

Github GitHub - ninjarobot/FsCloudInit: Builds cloud-init VM configuration files...
source link: https://github.com/ninjarobot/FsCloudInit
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md
FsCloudInit
Create cloud-init VM configuration files in F#.
Examples
Installing the dotnet 5.0 SDK on a VM. This pulls the Microsoft package source and signing key when building the cloud-init configuration.
async { // curl -sSL https://packages.microsoft.com/config/ubuntu/18.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list let! aptSourceRes = http.GetAsync "https://packages.microsoft.com/config/ubuntu/18.04/prod.list" |> Async.AwaitTask let! aptSource = aptSourceRes.Content.ReadAsStringAsync () |> Async.AwaitTask // curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - let! gpgKeyRes = http.GetAsync "https://packages.microsoft.com/keys/microsoft.asc" |> Async.AwaitTask let! gpgKey = gpgKeyRes.Content.ReadAsStringAsync () |> Async.AwaitTask { CloudConfig.Default with Apt = Apt ( Sources = dict [ "microsoft-prod", { AptSource.Default with Key = gpgKey; Source = aptSource} ] ) |> Some PackageUpdate = Some true Packages = [ Package "apt-transport-https" PackageVersion (PackageName="dotnet-sdk-5.0", PackageVersion="5.0.103-1") ] } |> Writer.write |> Console.WriteLine }
The above snippet writes a cloud-init configuration file to the console, resulting in the following configuration file that can be used to install the SDK on a server:
#cloud-config apt: sources: microsoft-prod: key: > -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.4.7 (GNU/Linux) mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV 7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag OeizPXmRljMtUUttHQZnRhtlzkmwIrUivbfFPD+fEoHJ1+uIdfOzZX8/oKHKLe2j H632kvsNzJFlROVvGLYAk2WRcLu+RjjggixhwiB+Mu/A8Tf4V6b+YppS44q8EvVr M+QvY7LNSOffSO6Slsy9oisGTdfE39nC7pVRABEBAAG0N01pY3Jvc29mdCAoUmVs ZWFzZSBzaWduaW5nKSA8Z3Bnc2VjdXJpdHlAbWljcm9zb2Z0LmNvbT6JATUEEwEC AB8FAlYxWIwCGwMGCwkIBwMCBBUCCAMDFgIBAh4BAheAAAoJEOs+lK2+EinPGpsH /32vKy29Hg51H9dfFJMx0/a/F+5vKeCeVqimvyTM04C+XENNuSbYZ3eRPHGHFLqe MNGxsfb7C7ZxEeW7J/vSzRgHxm7ZvESisUYRFq2sgkJ+HFERNrqfci45bdhmrUsy 7SWw9ybxdFOkuQoyKD3tBmiGfONQMlBaOMWdAsic965rvJsd5zYaZZFI1UwTkFXV KJt3bp3Ngn1vEYXwijGTa+FXz6GLHueJwF0I7ug34DgUkAFvAs8Hacr2DRYxL5RJ XdNgj4Jd2/g6T9InmWT0hASljur+dJnzNiNCkbn9KbX7J/qK1IbR8y560yRmFsU+ NdCFTW7wY0Fb1fWJ+/KTsC4= =J6gs -----END PGP PUBLIC KEY BLOCK----- source: deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main packages: - apt-transport-https - dotnet-sdk-5.0 package_update: true
Recommend
-
92
Files Permalink Latest commit message Commit time...
-
61
GitHub is where people build software. More than 28 million people use GitHub to discover, fork, and contribute to over 80 million projects.
-
59
README.md vim-nix
-
133
An Academic’s Opinionated DOOM Emacs Config About This Config This config has evolved over the last few months to reflect my needs as an academic. I initially started with emacs to take notes on papers. I eventually discover...
-
9
config_manager This is TJ's configuration repo. Feel free to use whatever you would like from it! It'd be great if you mentioned where it came from if you think it's cool. If you like what I'm doing, consider supporting me by...
-
7
Files Permalink Latest commit message Commit time
-
9
Files Permalink Latest commit message Commit time
-
7
SoftwareSpecFsInteractive/SoftwareSpec.ipynb at main · ninjarobot/SoftwareSpecFsInteractive · GitHub
-
5
FSharp.Text.Docker Interact with docker with the type safety of the F# language. Define a dockerfile A dockerfile can be built using a set of types for all of the supported instructions, providing type safety and comp...
-
6
FsCloudInit/cloud-init-with-farmer.ipynb at main · ninjarobot/FsCloudInit · GitHub
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK