GithubHelp home page GithubHelp logo

puppetlabs / puppetlabs-secure_env_vars Goto Github PK

View Code? Open in Web Editor NEW
0.0 50.0 2.0 17 KB

Run a command or script with sensitive environment variables.

License: Apache License 2.0

Ruby 76.41% Puppet 23.59%
module supported

puppetlabs-secure_env_vars's Introduction

secure_env_vars

Run a command or script with sensitive environment variables.

Table of Contents

Description

This module includes a single plan, secure_env_vars, which can be used to run a command or script on a list of targets with sensitive environment variables.

This is useful if you need to set environment variables on a target, but do not want to hard-code the values for the variables into your plan, as they contain sensitive information. Instead, Bolt will load the environment variables by reading the BOLT_ENV_VARS environment variable and parse it as JSON. The value of this environment variable should be a JSON object that maps environment variable names to values.

Parameters

targets

The targets to run the command or script on.

  • Type: Boltlib::TargetSpec

command

The command to run.

  • Type: String

script

The script to run.

  • Type: String

Usage

This plan can be used to run either a command or a script, but not both at the same time. If you provide both a command and script parameter, the plan will error.

Setting the environment variables

To set the environment variables that will be used by the command or script, set the BOLT_ENV_VARS environment variable to a JSON representation of a map of environment variable names to values.

For example, if you need to set the SECRET_PASSWORD environment variable for your command or script:

export BOLT_ENV_VARS='{"SECRET_PASSWORD":"$uper$ecretP@ssword!"}'

Running a command

To run a command, set the command parameter.

*nix shell command

bolt plan run secure_env_vars targets=servers command="git pull https://$OAUTH_TOKEN:[email protected]/name/repo.git master"

PowerShell cmdlet

Invoke-BoltPlan -Name secure_env_vars targets=servers command="git pull https://$OAUTH_TOKEN:x[email protected]/name/repo.git master"

Running a script

To run a script, set the script parameter. This can be either a relative path, absolute path, or a file from a module (e.g. modulename/script.sh).

*nix shell command

bolt plan run secure_env_vars targets=servers script=scripts/configure.sh

PowerShell cmdlet

Invoke-BoltPlan -Name secure_env_vars targets=servers script=scripts/configure.ps1

puppetlabs-secure_env_vars's People

Contributors

beechtom avatar lucywyman avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.