|
1 | 1 | # terraform-provider-matchbox
|
2 | 2 |
|
3 |
| -`terraform-provider-matchbox` allows defining [Matchbox](https://github.com/poseidon/matchbox) Profiles and Groups in Terraform. Matchbox matches machines, by label (e.g. MAC address), to Profiles with iPXE configs, Container Linux configs, or generic free-form configs to provision clusters. Resources are created via the client certificate authenticated Matchbox API. |
4 |
| - |
5 |
| -## Requirements |
6 |
| - |
7 |
| -* Terraform v0.11+ [installed](https://www.terraform.io/downloads.html) |
8 |
| -* Matchbox v0.8+ [installed](https://coreos.com/matchbox/docs/latest/deployment.html) |
9 |
| -* Matchbox credentials `client.crt`, `client.key`, `ca.crt` |
10 |
| - |
11 |
| -## Install |
12 |
| - |
13 |
| -Add the `terraform-provider-matchbox` plugin binary for your system to the Terraform 3rd-party [plugin directory](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) `~/.terraform.d/plugins`. |
14 |
| - |
15 |
| -```sh |
16 |
| -VERSION=v0.3.0 |
17 |
| -wget https://github.com/poseidon/terraform-provider-matchbox/releases/download/$VERSION/terraform-provider-matchbox-$VERSION-linux-amd64.tar.gz |
18 |
| -tar xzf terraform-provider-matchbox-$VERSION-linux-amd64.tar.gz |
19 |
| -mv terraform-provider-matchbox-$VERSION-linux-amd64/terraform-provider-matchbox ~/.terraform.d/plugins/terraform-provider-matchbox_$VERSION |
20 |
| -``` |
21 |
| - |
22 |
| -Terraform plugin binary names are versioned to allow for migrations of managed infrastructure. |
23 |
| - |
24 |
| -``` |
25 |
| -$ tree ~/.terraform.d/ |
26 |
| -/home/user/.terraform.d/ |
27 |
| -└── plugins |
28 |
| - ├── terraform-provider-matchbox_v0.2.2 |
29 |
| - ├── terraform-provider-matchbox_v0.2.3 |
30 |
| - └── terraform-provider-matchbox_v0.3.0 |
31 |
| -``` |
| 3 | +`terraform-provider-matchbox` allows defining [Matchbox](https://github.com/poseidon/matchbox) Profiles and Groups in Terraform. Matchbox matches machines, by label (e.g. MAC address), to Profiles with iPXE configs, Ignition configs, or generic free-form configs to provision clusters. Resources are created via the client certificate authenticated Matchbox API. |
32 | 4 |
|
33 | 5 | ## Usage
|
34 | 6 |
|
35 |
| -[Setup](https://coreos.com/matchbox/docs/latest/network-setup.html) a PXE network boot environment and [deploy](https://coreos.com/matchbox/docs/latest/deployment.html) a Matchbox instance. Be sure to enable the gRPC API and follow the instructions to generate TLS credentials. |
| 7 | +[Setup](https://matchbox.psdn.io/network-setup/) a PXE network boot environment and [deploy](https://matchbox.psdn.io/deployment/) a Matchbox instance. Be sure to enable the gRPC API and follow the instructions to generate TLS credentials. |
36 | 8 |
|
37 |
| -Configure the Matchbox provider to use your Matchbox API endpoint and client certificate in a `providers.tf` file. |
| 9 | +Configure the Matchbox provider with the Matchbox API endpoint and client certificate (e.g. `providers.tf`). |
38 | 10 |
|
39 | 11 | ```tf
|
40 | 12 | provider "matchbox" {
|
41 |
| - version = "0.3.0" |
| 13 | + version = "0.4.0" |
42 | 14 | endpoint = "matchbox.example.com:8081"
|
43 | 15 | client_cert = "${file("~/.matchbox/client.crt")}"
|
44 | 16 | client_key = "${file("~/.matchbox/client.key")}"
|
45 | 17 | ca = "${file("~/.matchbox/ca.crt")}"
|
46 | 18 | }
|
47 | 19 | ```
|
48 | 20 |
|
49 |
| -Run `terraform init` to ensure plugin version requirements are met. |
50 |
| - |
51 |
| -``` |
52 |
| -$ terraform init |
53 |
| -``` |
54 |
| - |
55 | 21 | Define a Matchbox Profile or Group resource in Terraform.
|
56 | 22 |
|
57 | 23 | ```tf
|
@@ -87,13 +53,46 @@ resource "matchbox_group" "node1" {
|
87 | 53 | }
|
88 | 54 | ```
|
89 | 55 |
|
| 56 | +Run `terraform init` to ensure plugin version requirements are met. |
| 57 | + |
| 58 | +``` |
| 59 | +$ terraform init |
| 60 | +``` |
| 61 | + |
90 | 62 | See [examples](https://github.com/poseidon/matchbox/tree/master/examples/terraform) for Terraform configs which PXE boot, install CoreOS, and provision entire clusters.
|
91 | 63 |
|
| 64 | +## Requirements |
| 65 | + |
| 66 | +* Terraform v0.11+ [installed](https://www.terraform.io/downloads.html) |
| 67 | +* Matchbox v0.8+ [installed](https://matchbox.psdn.io/deployment/) |
| 68 | +* Matchbox credentials `client.crt`, `client.key`, `ca.crt` |
| 69 | + |
| 70 | +## Install |
| 71 | + |
| 72 | +Add the `terraform-provider-matchbox` plugin binary for your system to the Terraform 3rd-party [plugin directory](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) `~/.terraform.d/plugins`. |
| 73 | + |
| 74 | +```sh |
| 75 | +VERSION=v0.4.0 |
| 76 | +wget https://github.com/poseidon/terraform-provider-matchbox/releases/download/$VERSION/terraform-provider-matchbox-$VERSION-linux-amd64.tar.gz |
| 77 | +tar xzf terraform-provider-matchbox-$VERSION-linux-amd64.tar.gz |
| 78 | +mv terraform-provider-matchbox-$VERSION-linux-amd64/terraform-provider-matchbox ~/.terraform.d/plugins/terraform-provider-matchbox_$VERSION |
| 79 | +``` |
| 80 | + |
| 81 | +Terraform plugin binary names are versioned to allow for migrations of managed infrastructure. |
| 82 | + |
| 83 | +``` |
| 84 | +$ tree ~/.terraform.d/ |
| 85 | +/home/user/.terraform.d/ |
| 86 | +└── plugins |
| 87 | + ├── terraform-provider-matchbox_v0.3.0 |
| 88 | + └── terraform-provider-matchbox_v0.4.0 |
| 89 | +``` |
| 90 | + |
92 | 91 | ## Development
|
93 | 92 |
|
94 | 93 | ### Binary
|
95 | 94 |
|
96 |
| -To develop the provider plugin locally, build an executable with Go 1.11+. |
| 95 | +To develop the provider plugin locally, build an executable with Go 1.12+. |
97 | 96 |
|
98 | 97 | ```
|
99 | 98 | make
|
|
0 commit comments