diff options
author | Cara Salter <cara@devcara.com> | 2022-07-09 22:27:43 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-07-09 22:42:41 -0400 |
commit | 5429fcc0859c93da965e91e94e6676c2e6cdd24e (patch) | |
tree | 3adda02260db5a63f1b5dec706f39b99b4b6ac4f /src/colony.rs | |
parent | ec087f3d08f5861b6ffcce00a632858a57c86d31 (diff) | |
download | solarlib-5429fcc0859c93da965e91e94e6676c2e6cdd24e.tar.gz solarlib-5429fcc0859c93da965e91e94e6676c2e6cdd24e.zip |
colony: Initial cloud-init support
Diffstat (limited to 'src/colony.rs')
-rw-r--r-- | src/colony.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/colony.rs b/src/colony.rs new file mode 100644 index 0000000..2657fef --- /dev/null +++ b/src/colony.rs @@ -0,0 +1,38 @@ +/*! + * A Colony is cloud-init data that can be used to set up a new planet + **/ + +/* + * Colonies basically need to store things like any files that need to be created in the VM and + * users that should be added. This needs to be serialized into a cloud-init document that can then + * (somehow) be thrown into QEMU + */ + +use serde::{Deserialize, Serialize}; +use ulid::Ulid; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct Colony { + pub user_data: UserData, + pub meta_data: MetaData, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct UserData { + pub users: Vec<User>, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct User { + pub name: String, + pub groups: Vec<String>, + pub ssh_authorized_keys: Vec<String>, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct MetaData { + #[serde(rename = "instance-id")] + pub instance_id: Ulid, + #[serde(rename = "local-hostname")] + pub hostname: String +} |