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
25 lines
506 B
Terraform
25 lines
506 B
Terraform
resource "kea_subnet" "lab" {
|
|
name = "lab"
|
|
cluster_ref = "primary"
|
|
subnet = "10.0.0.0/24"
|
|
|
|
pools = ["10.0.0.100-10.0.0.200"]
|
|
routers = ["10.0.0.1"]
|
|
dns_servers = ["10.0.0.53"]
|
|
domain_name = "lab.unkin.net"
|
|
valid_lifetime = 3600
|
|
|
|
# PXE boot options
|
|
next_server = "10.0.0.1"
|
|
boot_file_name = "pxelinux.0"
|
|
client_classes = ["pxeclients"]
|
|
|
|
option_data = [
|
|
{
|
|
name = "tftp-server-name"
|
|
code = 66
|
|
data = "10.0.0.1"
|
|
},
|
|
]
|
|
}
|