All Projects → poseidon → Terraform Provider Matchbox

poseidon / Terraform Provider Matchbox

Licence: apache-2.0
Terraform provider for Matchbox on-premise / bare-metal provisioning

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Terraform Provider Matchbox

Terraform Provider Kubernetes
Terraform Kubernetes provider
Stars: ✭ 898 (+798%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Google
Terraform Google Cloud Platform provider
Stars: ✭ 1,318 (+1218%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Dome9
Terraform Provider for Dome9
Stars: ✭ 33 (-67%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Tls
Provides utilities for working with Transport Layer Security keys and certificates. It provides resources that allow private keys, certificates and certficate requests to be created as part of a Terraform deployment.
Stars: ✭ 88 (-12%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Fastly
Terraform Fastly provider
Stars: ✭ 65 (-35%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Libvirt
Terraform provider to provision infrastructure with Linux's KVM using libvirt
Stars: ✭ 894 (+794%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Zabbix
Stars: ✭ 38 (-62%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Oci
Terraform Oracle Cloud Infrastructure provider
Stars: ✭ 400 (+300%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Sumologic Old
Go to the new provider repo --->
Stars: ✭ 60 (-40%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Secret
Terraform secret provider
Stars: ✭ 55 (-45%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Tencentcloud
Terraform TencentCloud Provider
Stars: ✭ 85 (-15%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Vcd
Terraform VMware vCloud Director provider
Stars: ✭ 73 (-27%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Helm
Terraform Helm provider
Stars: ✭ 704 (+604%)
Mutual labels:  terraform, terraform-provider
Namecheap
Go library for Namecheap API
Stars: ✭ 18 (-82%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Aws
Terraform AWS provider
Stars: ✭ 6,624 (+6524%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Packet
Terraform provider for Equinix Metal (formerly Packet)
Stars: ✭ 33 (-67%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Alicloud
Terraform AliCloud provider
Stars: ✭ 340 (+240%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Vsphere
Terraform VMware vSphere provider
Stars: ✭ 380 (+280%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Netlify
Terraform Netlify provider. Please note: This Terraform provider is archived per our provider archiving process: https://terraform.io/docs/internals/archiving.html
Stars: ✭ 51 (-49%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Aiven
Terraform Aiven provider
Stars: ✭ 68 (-32%)
Mutual labels:  terraform, terraform-provider

terraform-provider-matchbox Build Status

terraform-provider-matchbox allows defining 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.

Usage

Setup a PXE network boot environment and deploy a Matchbox instance. Be sure to enable the gRPC API and follow the instructions to generate TLS credentials.

Configure the Matchbox provider with the Matchbox API endpoint and client certificate (e.g. providers.tf).

provider "matchbox" {
  endpoint    = "matchbox.example.com:8081"
  client_cert = "${file("~/.matchbox/client.crt")}"
  client_key  = "${file("~/.matchbox/client.key")}"
  ca          = "${file("~/.matchbox/ca.crt")}"
}

terraform {
  required_providers {
    matchbox = {
      source = "poseidon/matchbox"
      version = "0.4.1"
    }
  }
}

Define a Matchbox Profile or Group resource in Terraform.

// Create a Container Linux install profile
resource "matchbox_profile" "container-linux-install" {
  name = "container-linux-install"
  kernel = "/assets/coreos/${var.container_linux_version}/coreos_production_pxe.vmlinuz"
  initrd = [
    "/assets/coreos/${var.container_linux_version}/coreos_production_pxe_image.cpio.gz"
  ]
  args = [
    "coreos.config.url=http://${var.matchbox_http_endpoint}/ignition?uuid=$${uuid}&mac=$${mac:hexhyp}",
    "coreos.first_boot=yes",
    "console=tty0",
    "console=ttyS0",
    "coreos.autologin"
  ]
  container_linux_config = "${file("./cl/coreos-install.yaml.tmpl")}"
  generic_config = "${file("./example.ks")}"
}

// Match a bare-metal machine
resource "matchbox_group" "node1" {
  name = "node1"
  profile = "${matchbox_profile.container-linux-install.name}"
  selector = {
    mac = "52:54:00:a1:9c:ae"
  }
  metadata = {
    custom_variable = "machine_specific_value_here"
    ssh_authorized_key = "${var.ssh_authorized_key}"
  }
}

Run terraform init to ensure plugin version requirements are met.

$ terraform init

See examples for Terraform configs which PXE boot, install CoreOS, and provision entire clusters.

Requirements

  • Terraform v0.12+ installed
  • Matchbox v0.8+ installed
  • Matchbox credentials client.crt, client.key, ca.crt

Development

Binary

To develop the provider plugin locally, build an executable with Go 1.12+.

make

Vendor

Add or update dependencies in go.mod and vendor.

make update
make vendor

Legacy Install

For Terraform v0.12, add the terraform-provider-matchbox plugin binary for your system to the Terraform 3rd-party plugin directory ~/.terraform.d/plugins.

VERSION=v0.4.0
wget https://github.com/poseidon/terraform-provider-matchbox/releases/download/$VERSION/terraform-provider-matchbox-$VERSION-linux-amd64.tar.gz
tar xzf terraform-provider-matchbox-$VERSION-linux-amd64.tar.gz
mv terraform-provider-matchbox-$VERSION-linux-amd64/terraform-provider-matchbox ~/.terraform.d/plugins/terraform-provider-matchbox_$VERSION

Terraform plugin binary names are versioned to allow for migrations of managed infrastructure.

$ tree ~/.terraform.d/
/home/user/.terraform.d/
└── plugins
    ├── terraform-provider-matchbox_v0.3.0
    └── terraform-provider-matchbox_v0.4.0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].