{"id":16880167,"url":"https://github.com/jalseth/nocloud-metadata-server","last_synced_at":"2025-07-26T20:05:41.117Z","repository":{"id":109438794,"uuid":"609616951","full_name":"jalseth/nocloud-metadata-server","owner":"jalseth","description":"Metadata server to configure Cloud-Init VMs in non-cloud environments.","archived":false,"fork":false,"pushed_at":"2023-11-07T17:19:36.000Z","size":4191,"stargazers_count":33,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T22:06:43.947Z","etag":null,"topics":["cloud-init","nocloud"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jalseth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-04T18:07:11.000Z","updated_at":"2025-03-18T04:38:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"d411f8bf-0a6a-42ef-9061-f51a31432864","html_url":"https://github.com/jalseth/nocloud-metadata-server","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalseth%2Fnocloud-metadata-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalseth%2Fnocloud-metadata-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalseth%2Fnocloud-metadata-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jalseth%2Fnocloud-metadata-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jalseth","download_url":"https://codeload.github.com/jalseth/nocloud-metadata-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245131252,"owners_count":20565788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-init","nocloud"],"created_at":"2024-10-13T15:57:42.558Z","updated_at":"2025-03-23T16:32:52.210Z","avatar_url":"https://github.com/jalseth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NoCloud Metadata Server\n\nA simple service for dynamically configuring Cloud-Init VMs using NoCloud, such\nas in edge compute environments and homelabs.\n\n## Config file structure\n\nThe server's configuration is loaded from a `config.yaml` file. It defaults to\nchecking the current directory. Alternate paths can be specified using the\n`--config=path/to/config.yaml` flag.\n\nThe configuration is comprised of two main parts:\n\n1.  Server configs which defines basic information such as the regex patterns\n    to trigger on, and the hostname to set.\n1.  User data templates, which define any number of\n    [user data modules](https://cloudinit.readthedocs.io/en/latest/reference/modules.html)\n    to be provisioned.\n\nA user data template may be referenced by multiple server configs via the\n`userDataTemplate` field. Each server config also has a `replacements` map that\nallows multiple similar server configs to reuse a single user data template,\nwhile customizing some fields by merging the map with the template.\n\n### Example\n\nThis example has a common base config which updates the system's packages\non first boot, disables SSH password authentication, and then includes \ndev OR prod SSH keys depending on the requested URL.\n\n```yaml\nuserDataTemplates:\n  basic:\n    package_upgrade: true\n    ssh_pwauth: false\n\nserverConfigs:\n- name: \"basic-dev\"\n  matchPatterns:\n  - \"dev\"\n  instanceConfig:\n    hostname: \"basic-dev\"\n    enableInstanceIDSuffix: true\n    enableHostnameSuffix: true\n  userDataTemplate: \"basic\"\n  replacements:\n    ssh_authorized_keys:\n    - ssh-rsa dev-management-ssh-key...\n\n- name: \"basic-prod\"\n  matchPatterns:\n  - \"prod\"\n  instanceConfig:\n    hostname: \"basic-prod\"\n    enableInstanceIDSuffix: true\n    enableHostnameSuffix: true\n  userDataTemplate: \"basic\"\n  replacements:\n    ssh_authorized_keys:\n    - ssh-rsa prod-management-ssh-key...\n```\n\n```sh\n$ curl localhost:8000/dev/meta-data\ninstance-id: i-dev-4a467d03\nlocal-hostname: basic-dev-4a467d03\nhostname: basic-dev-4a467d03\n\n$ curl localhost:8000/dev/user-data\npackage_upgrade: true\nssh_authorized_keys:\n  - ssh-rsa dev-management-ssh-key...\nssh_pwauth: false\n\n$ curl localhost:8000/prod/meta-data\ninstance-id: i-prod-0138fed4\nlocal-hostname: basic-prod-0138fed4\nhostname: basic-prod-0138fed4\n\n$ curl localhost:8000/prod/user-data\npackage_upgrade: true\nssh_authorized_keys:\n  - ssh-rsa prod-management-ssh-key...\nssh_pwauth: false\n```\n\n## Integration with QEMU/KVM\n\nWhen creating QEMU VMs, you configure the SMBIOS serial such that Cloud-Init\nwill retrieve the configuration from the metadata server after networking\nhas been initialized.\n\nContinuing the config example above, the options below would configure\nCloud-Init to use the NoCloud data store, and to fetch the `dev` configuration\nfrom the metadata server running at `10.10.10.10:8000`.\n\n```\n-smbios type=1,serial=ds=nocloud-net;s=http://10.10.10.10:8000/dev/\n```\n\nSee the [NoCloud docs](https://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html)\nand this helpful [chart](https://gist.github.com/smoser/290f74c256c89cb3f3bd434a27b9f64c)\nmapping DMI/SMBIOS options for more information on this subject.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalseth%2Fnocloud-metadata-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjalseth%2Fnocloud-metadata-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjalseth%2Fnocloud-metadata-server/lists"}