7c851b8df5
Terraform/OpenTofu provider wrapping the kea-operator KeaAPI, modelled on
terraform-provider-encapi.
- add kea_subnet and kea_clientclass resources with full CRUD over the
PUT/GET/DELETE /api/v1/{subnets,clientclasses}/{name} contract
- add provider config (endpoint + bearer token, KEA_API_TOKEN fallback);
404 on read removes the resource from state
- add unit tests against httptest mock servers (client, wire round-trip,
type conversions, schemas)
- add Makefile (patch|minor|major + package) and .woodpecker CI mirroring
terraform-provider-encapi; tag release PUTs the zip to the artifactapi
terraform-unkin registry under unkin/kea
Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT
31 lines
678 B
Go
31 lines
678 B
Go
// Command terraform-provider-kea is the Terraform/OpenTofu provider for the
|
|
// kea-operator KeaAPI: it manages Kea DHCP subnets and PXE client classes.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"log"
|
|
|
|
"github.com/hashicorp/terraform-plugin-framework/providerserver"
|
|
|
|
"git.unkin.net/unkin/terraform-provider-kea/internal/provider"
|
|
)
|
|
|
|
var version = "0.0.1"
|
|
|
|
func main() {
|
|
var debug bool
|
|
flag.BoolVar(&debug, "debug", false, "enable debug mode")
|
|
flag.Parse()
|
|
|
|
opts := providerserver.ServeOpts{
|
|
Address: "git.unkin.net/unkin/kea",
|
|
Debug: debug,
|
|
}
|
|
|
|
if err := providerserver.Serve(context.Background(), provider.New(version), opts); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|