Skip to content

Setting up your environment

Rob Nelson edited this page Feb 9, 2016 · 3 revisions

Preparation

Before standing up the lab, you will need to fork or duplicate some repositories.

The original repositories are public. Any forks will also be public. Some data may be considered identifying or at risk and you may wish to use a private repo. GitHub has directions to duplicate a public repo as a private repo

These repos will become specific to your lab environment and it is suggested that they be forked or duplicated.

The repository URLs, whether forks, duplicates, or originals, will be used during the next step.

Git Modifications

In your controlrepo production branch, modify the git references in the Puppetfile to point to your fork/duplicate repos:

# Original
mod 'lab_config',
  :git => 'git@github.com:puppetinabox/lab_config'
...
    
# New
mod 'lab_config',
  :git => 'git@github.com:example/lab_config'
...

Modify r10k_installation.pp to reference the new controlrepo location:

# Original
class { 'r10k':
  version => '2.1.1',
  sources => {
    'puppet' => {
      'remote'  => 'git@github.com:puppetinabox/controlrepo.git',
      'basedir' => $::settings::environmentpath,
      'prefix'  => false,
    }
  },
  manage_modulepath => false
}

# New
class { 'r10k':
  version => '2.1.1',
  sources => {
    'puppet' => {
      'remote'  => 'git@github.com:example/controlrepo.git',
      'basedir' => $::settings::environmentpath,
      'prefix'  => false,
    }
  },
  manage_modulepath => false
}

You may also modify the settings in hiera.pp if you desire (optional).

Hiera data is located in the controlrepo's hiera directory. Configuration files, such as DNS zones, are located in the lab_config repository's files directories.

Commit and push the changes upstream:

git commit -am 'Initial commit of my new puppetized setup'
# controlrepo
git push origin production
# lab_config
git push origin master

You're ready to rock'n'roll!