Skip to content

alexkappa/terraform-provider-fleet

 
 

Repository files navigation

terraform-provider-fleet

A plugin for Terraform enabling it to manipulate Fleet (CoreOS) units.

Circle CI

Installation

  1. Install Terraform.
  2. go get github.com/paperg/terraform-provider-fleet

Usage

There is only one resource: fleet_unit. Here is the first example from the Fleet introduction, transcribed to Terraform:

provider "fleet" {
    tunnel_address = "IP_OR_HOSTNAME_OF_A_COREOS_HOST"
}

resource "fleet_unit" "myapp" {
    name = "myapp.service"
    desired_state = "launched" // "inactive", "loaded", or "launched"
    section {
        name = "Unit"

        option {
            name = "Description"
            value = "MyApp"
        }

        option {
            name = "After"
            value = "docker.service"
        }

        option {
            name = "Requires"
            value = "docker.service"
        }
    }

    section {
        name = "Service"

        option {
            name = "TimeoutStartSec"
            value = "0"
        }

        option {
            name = "ExecStartPre"
            value = "-/usr/bin/docker kill busybox2"
        }

        option {
            name = "ExecStartPre"
            value = "-/usr/bin/docker rm busybox2"
        }

        option {
            name = "ExecStartPre"
            value = "/usr/bin/docker pull busybox"
        }

        option {
            name = "ExecStart"
            value = "/usr/bin/docker run --name busybox2 busybox /bin/sh -c 'while true; do echo Hello World; sleep 1; done'"
        }

        option {
            name = "ExecStop"
            value = "/usr/bin/docker busybox2"
        }
    }
}

API stability

Both Terraform and Fleet are 0.x projects. Expect incompatible changes.

About

Fleet (CoreOS) plugin for Terraform

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%