Cloud-Init utilities to create cloud-init ISO to configure cloud images.
This project provides a set of utilities for generating cloud-init configurations and ISO images. Cloud-init is a widely used tool for initializing cloud instances, allowing users to customize their cloud environments at boot time.
- Generate cloud-init configuration files in YAML format.
- Create ISO images containing cloud-init configurations.
- Support for user management, including password and SSH key configuration.
- Ability to configure network settings and run custom commands on first boot.
- File writing support for custom configurations
- Storage configuration capabilities
- Network interface management
To install the CloudInit GO package, use the following command:
go get go.pilab.hu/cloud/cloud-initimport cloudinit "go.pilab.hu/cloud/cloud-init"
// Create a new configuration
config := cloudinit.NewConfig()
// Add a user
config.AddUser(cloudinit.User{
Name: "admin",
Groups: "sudo",
Shell: "/bin/bash",
Sudo: "ALL=(ALL) NOPASSWD:ALL",
AuthorizedKeys: []string{"ssh-rsa AAAAB..."},
})
// Write configuration to ISO
file, _ := os.Create("cloud-init.iso")
defer file.Close()
config.WriteISO(file)Contributions are welcome! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure to update tests as appropriate and follow the existing coding style.
- Go 1.23 or higher
- Make (for building and testing)
- Git
go test ./... -vThis project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who have helped shape this project
- Built with Go and ❤️