Puppet provisioner for Terraform
Switch branches/tags
Nothing to show
Clone or download
Latest commit dc51f0a Nov 8, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore init Nov 7, 2017
.travis.yml init Nov 7, 2017
LICENSE Initial commit Oct 26, 2017
README.md add build status Nov 7, 2017
main.go fix codestyle Nov 8, 2017
provisioner.go fix codestyle Nov 8, 2017
resource_provisioner.go fix codestyle Nov 8, 2017

README.md

terraform-provisioner-puppet [experimental]

Build Status

Provision terraform resources with puppet

Overview

Terraform is a tool for automating infrastructure. Terraform includes the ability to provision resources at creation time through a plugin api. Currently, some builtin provisioners such as chef and standard scripts are provided; this provisioner introduces the ability to provision an instance at creation time with puppet.

This provisioner provides the ability to install puppet agent and try to configure instance.

terraform-provisioner-puppet is shipped as a Terraform module. To include it, simply download the binary and enable it as a terraform module in your terraformrc.

Installation

go get github.com/pyToshka/terraform-provisioner-puppet

terraform-provisioner-puppet ships as a single binary and is compatible with terraform's plugin interface. Behind the scenes, terraform plugins use https://github.com/hashicorp/go-plugin and communicate with the parent terraform process via RPC.

Once installed, a ~/.terraformrc file is used to enable the plugin.

providers {
    puppet = "/usr/local/bin/terraform-provisioner-puppet"
}

Usage

Once installed, you can provision resources by including an puppet provisioner block.

The following example demonstrates a configuration block to install and running puppet agent to new instances.

resource "aws_instance" "puppetagent" {
    ami = "${var.ami_id}"
    instance_type = "${var.instance_type}"
    iam_instance_profile = "${var.iam_instance_profile}"
    count = 1
    tags {
        Name = "puppet-agent.example.com"
        puppet_role = "base"
        CNAME = "puppet-agent.example.com."
    }
    key_name = "${var.aws_key_name}"
    subnet_id = "${var.subnet_id}"
    security_groups = ["${var.security_group}"]
    vpc_security_group_ids = ["${var.security_group}"]
   provisioner "puppet" {
     connection {
       user = "ubuntu" //username for ssh connection
       private_key = "${file("key.pem")}"
     }
     puppetmaster_ip="172.22.61.191" #ip of Puppet Master
     use_sudo = true
   }
}

e

I'm not testing the custom_command. Full working are granted only with Ubuntu based distribution