A plugin for Terraform enabling it to manipulate Fleet (CoreOS) units.
- Install Terraform.
go get github.com/paperg/terraform-provider-fleet
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"
}
}
}
Both Terraform and Fleet are 0.x projects. Expect incompatible changes.