Skip to content

Commit

Permalink
Add documentation, add workflow unshallow step
Browse files Browse the repository at this point in the history
Signed-off-by: Feliksas <[email protected]>
  • Loading branch information
Feliksas committed Nov 8, 2022
1 parent e99c9e1 commit 086971f
Show file tree
Hide file tree
Showing 11 changed files with 313 additions and 37 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v3
with:
Expand Down
49 changes: 49 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
page_title: "Provider: kea-dhcp4"
description: |-
Provider for ISC Kea DHCP server for provisioning static DHCP leases.
---

# KEA-DHCP4 Provider

The provider uses Kea Control Agent's REST API for communication with an underlying Kea DHCP4 server (DHCP6 currently not supported), with optional reverse proxying for adding TLS and authentication.

Before using the provider, you must correctly specify the connection URL, credentials (if any), and path to DHCP server conffile on host (required for config-write API command).


## Requirements

* ISC Kea DHCP server v1.8+
* Terraform 0.14+

## Example Usage
```terraform
terraform {
required_providers {
kea-dhcp4 = {
source = "Feliksas/kea-dhcp4"
version = "1.1.0"
}
}
}
provider "kea-dhcp4" {
kea_server_address = "http://localhost:8080"
kea_server_username = "test"
kea_server_password = "1234"
kea_server_configfile = "/etc/kea/kea-dhcp4.conf"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `kea_server_address` (String) IP or FQDN of host which serves Kea Control Agent API
- `kea_server_configfile` (String) Path to Kea DHCP4 server config (on server, required for config-write command)

### Optional

- `kea_server_password` (String) HTTP basic auth password (if configured)
- `kea_server_username` (String) HTTP basic auth username (if configured)
49 changes: 49 additions & 0 deletions docs/resources/host_lease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# kea-dhcp4_host_lease (Resource)


## Example Usage
```terraform
resource "kea-dhcp4_host_lease" "some_host" {
name = "some_host.local"
mac_address = "00:11:22:33:44:55"
ip_address = "10.0.0.1"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `ip_address` (String) ip address to assign for mac
- `mac_address` (String) mac address in lower-case
- `name` (String) lease_name in lowercase

### Optional

- `boot_file_name` (String) (Optional) Path to boot file on TFTP server
- `client_classes` (List of String) (Optional) List of client classes to apply
- `next_server` (String) (Optional) TFTP server to boot from
- `option_data` (Block List) (Optional) List of custom DHCP options for host (see [below for nested schema](#nestedblock--option_data))
- `server_hostname` (String) (Optional) TFTP server hostname

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--option_data"></a>
### Nested Schema for `option_data`

Required:

- `data` (String) DHCP option data

Optional:

- `always_send` (Boolean) (Optional) Force sending this DHCP option
- `code` (Number) (Optional) DHCP option code
- `csv_format` (Boolean) (Optional) Set to true if data is specified in hex format
- `name` (String) (Optional) DHCP option name
- `space` (String) (Optional) DHCP space identifier, default is dhcp4


15 changes: 15 additions & 0 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_providers {
kea-dhcp4 = {
source = "Feliksas/kea-dhcp4"
version = "1.1.0"
}
}
}

provider "kea-dhcp4" {
kea_server_address = "http://localhost:8080"
kea_server_username = "test"
kea_server_password = "1234"
kea_server_configfile = "/etc/kea/kea-dhcp4.conf"
}
5 changes: 5 additions & 0 deletions examples/resources/kea-dhcp4_host_lease/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "kea-dhcp4_host_lease" "some_host" {
name = "some_host.local"
mac_address = "00:11:22:33:44:55"
ip_address = "10.0.0.1"
}
47 changes: 34 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,59 @@ module terraform-provider-kea-dhcp4

go 1.17

require github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
require (
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.8.0
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
github.com/agext/levenshtein v1.2.2 // indirect
github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/fatih/color v1.7.0 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-checkpoint v0.5.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
github.com/hashicorp/go-hclog v0.15.0 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.1 // indirect
github.com/hashicorp/go-uuid v1.0.1 // indirect
github.com/hashicorp/go-version v1.3.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.4.0 // indirect
github.com/hashicorp/hcl/v2 v2.8.2 // indirect
github.com/hashicorp/terraform-exec v0.17.2 // indirect
github.com/hashicorp/terraform-json v0.14.0 // indirect
github.com/hashicorp/terraform-plugin-go v0.4.0 // indirect
github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/cli v1.1.4 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-testing-interface v1.0.4 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/russross/blackfriday v1.6.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/zclconf/go-cty v1.8.4 // indirect
golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 // indirect
golang.org/x/text v0.3.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
github.com/zclconf/go-cty v1.10.0 // indirect
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d // indirect
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect
golang.org/x/sys v0.0.0-20220627191245-f75cf1eec38b // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect
google.golang.org/grpc v1.32.0 // indirect
Expand Down
Loading

0 comments on commit 086971f

Please sign in to comment.