Forge Home

dynenv

Configure dynamic environments for puppet

10,068 downloads

10,068 latest version

2.0 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.

Version information

  • 0.1.0 (latest)
released Dec 14th 2012

Start using this module

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

Add this module to your Puppetfile:

mod 'dhgwilliam-dynenv', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dhgwilliam-dynenv
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dhgwilliam-dynenv --version 0.1.0

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

dhgwilliam/dynenv — version 0.1.0 Dec 14th 2012

dynenv - to manage dynamic puppet environments with git

ideated and documented in a Puppet Labs blog post and using the puppet-sync script from PSU's Computer Action Team

NB: there are other people out there hacking on Dynamic Environments, so when their blogs are back up we should add a link to the relevant post

Dependencies

In order for this to work, you must have reasonably configured the following tools, preferably on both boxes:

  • git
  • ruby (available in the PATH)

You also must have storeconfigs = true enabled in your puppetmaster's puppet.conf

Sample Usage

    class { 'usa-perf-dynenv':
      # this user need not exist on the destination boxes
      dynenv::user { 'dhgwilliam':
        key_type => 'ssh-rsa',
        key => 'AAAA(.*)=',
      }
      
      class { 'dynenv':
        sync_user => 'puppet-sync',
        puppetmaster_fqdn => 'puppet.perf.usacompany.com',
        githost_fqdn => 'usa-pup-git-01.perf.usacompany.com',
        git_repo => '/var/lib/git/modules',
        env_dir => '/etc/puppetlabs/puppet/environments',
      }
    }
    
    node 'usa-pup-git-01' {
      include usa-perf-dynenv
    }
    
    node 'puppet.perf' {
      include usa-perf-dynenv
    }
    

Caveats/Warnings/Issues

this module assumes that githost and puppetmaster are on separate boxes. That said, I suspect it would work just fine if puppetmaster_fqdn and githost_fqdn were the same, although I have not tested this.

the module explicitly does not manage the modules repo for you, so when creating a new git_host, you must either copy an existing repo or create a bare one with git init .

You must manually alter the puppetmaster's puppet.conf to actually enable the dynamic environments, this only lays out the filesystem foundation.

I'd imagine there are some other assumptions contained herein that are undocumented.