Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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

About

Puppet provisioner for Terraform

Resources

License

Packages

No packages published

Languages