Forge Home

set_env

Module for setting environment variables during puppet agent runs

13,507 downloads

13,030 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.2.1 (latest)
  • 0.1.1
  • 0.1.0
released Feb 19th 2015
This version is compatible with:
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'vormetriclabs-set_env', '0.2.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add vormetriclabs-set_env
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install vormetriclabs-set_env --version 0.2.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

vormetriclabs/set_env — version 0.2.1 Feb 19th 2015

set_env - Set Environment Variables during Puppet Runs

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with set_env
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

When working with the puppetlabs-aws module we found it painful and less secure to have to hard code credentials, or store a file on the target puppet agent host with sensitive data in them. So instead we wanted pass the sensitive data in an environment variable. And thus the birth of set_env...

Module Description

set_env is a Puppet Custom Type that will set a variable for the current running puppet run

Setup

Installation is simple...

puppet module install vormetriclabs-set_env

or if using Librarian or r10k, add it to your Puppetfile

mod "vormetriclabs-set_env"

What set_env affects

  • The environment variables of the puppet agent during it's run only...

Usage

Setting a temporary environment variable is pretty easy:

set_env {"variable_name":
    value => "variable_value"
}

For example to set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY for use in puppetlabs-aws

set_env {"AWS_ACCESS_KEY_ID":
    value => "ABCDEFG123456"
}
set_env {"AWS_SECRET_ACCESS_KEY":
    value => "abcdefg123456?!@#$%"
}

Reference

Here, list the classes, types, providers, facts, etc contained in your module. This section should include all of the under-the-hood workings of your module so people know what the module is touching on their system but don't need to mess with things. (We are working on automating this section!)

Limitations

Tested on:

  • Windows 7, 8, 8.1
  • CentOS/RHEL 5, 6, 7
  • Ubuntu 12.04, 14.04 LTS

Should work with just about any other OS though as its only requirements are puppet and ruby.

Development

Feel free to submit issues, or pull requests