pmorillon / terraform-provider-grid5000

Terraform provider plugin for OAR jobs submission and Kadeploy bare-metal deployments on Grid'5000
Mozilla Public License 2.0
3 stars 2 forks source link

Terraform provider for Grid5000

Requirements

Installation

Terraform >= 0.13.x

Add this into your Terraform configuration, then run terraform init :

terraform {
  required_providers {
    grid5000 = {
      source = "pmorillon/grid5000"
      version = "0.0.8"
    }
  }
}

Terraform = 0.12.x

Downloadable packages are available at Grid5000 provider releases.

How to install:

Directory Purpose
. In case the provider is only used in a single Terraform project.
~/.terraform.d/plugins The user plugins directory.

Usage

provider "grid5000" {
  # Basic Auth
  username = "john"
  password = "xxx"
}

Or :

provider "grid5000" {
  # Uses Restfully credentials
  restfully_file = "/home/user/.restfully/api.grid5000.fr.yml"
}
resource "grid5000_job" "my_job" {
  name      = "terraform"
  site      = "rennes"
  command   = "sleep 1h"
  resources = "/nodes=2"
  types     = ["deploy"]
}
resource "grid5000_deployment" "my_deployment" {
  site        = "rennes"
  environment = "debian10-x64-base"
  nodes       = grid5000_job.my_job.assigned_nodes
  key         = file("~/.ssh/id_rsa.pub")
}