terraform-provisioner-puppet

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2017 License: BSD-3-Clause Imports: 10 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL