Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

At this point there are a working puppet infrastructure in place. Next up is installing and configuring r10k, and deploying your first environment. In this example the environment "infrastructure" is deployed:

Code Block
titlePuppet SSL certificatesInstall r10k
root@bootstrap:~# /opt/puppetlabs/puppet/bin/gem install r10k
root@bootstrap:~# mkdir /etc/puppetlabs/r10k
root@bootstrap:~# vim /etc/puppetlabs/r10k/r10k.yaml
root@bootstrap:~# cat /etc/puppetlabs/r10k/r10k.yaml
---
:cachedir: /opt/puppetlabs/puppet/cache/r10k
:sources:
  puppet:
    basedir: /etc/puppetlabs/code/environments
    remote: https://github.com/ntnusky/r10k.git
root@bootstrap:~# /opt/puppetlabs/puppet/bin/r10k deploy environment infrastructure -pv

Set up hiera

Create the folder for the hieradata, create the initial datafiles, initialize a git-repo and commit the initial structures.

Code Block
titleSet up hiera datafiles
root@bootstrap:~# mkdir /etc/puppetlabs/puppet/data
root@bootstrap:~# cd /etc/puppetlabs/puppet/data
root@bootstrap:/etc/puppetlabs/puppet/data# mkdir nodes
root@bootstrap:/etc/puppetlabs/puppet/data# touch common.yaml networking.yaml packages.yaml sensu.yaml users.yaml nodes/bootstrap.infra.skyhigh.iik.ntnu.no
root@bootstrap:/etc/puppetlabs/puppet/data# git init .
Initialized empty Git repository in /etc/puppetlabs/puppet/data/.git/
root@bootstrap:/etc/puppetlabs/puppet/data# git add .
root@bootstrap:/etc/puppetlabs/puppet/data# git commit -m "Initial import"

To configure hiera you might simply pull the latest version of the hiera.yaml file from github:

 

Code Block
titleConfigure hiera
root@bootstrap:~# mkdir /etc/puppetlabs/puppet/data
root@bootstrap:~# cd /etc/puppetlabs/puppet/data
root@bootstrap:/etc/puppetlabs/puppet/data# mkdir nodes
root@bootstrap:/etc/puppetlabs/puppet/data# touch common.yaml networking.yaml packages.yaml sensu.yaml users.yaml nodes/bootstrap.infra.skyhigh.iik.ntnu.no
root@bootstrap:/etc/puppetlabs/puppet/data# git init .
Initialized empty Git repository in /etc/puppetlabs/puppet/data/.git/
root@bootstrap:/etc/puppetlabs/puppet/data# git add .
root@bootstrap:/etc/puppetlabs/puppet/data# git commit -m "Initial import"

 

 

 

Code Block
titleSet up hiera datafiles
root@bootstrap:~# mkdir /etc/puppetlabs/puppet/data
root@bootstrap:~# cd /etc/puppetlabs/puppet/data
root@bootstrap:/etc/puppetlabs/puppet/data# mkdir nodes
root@bootstrap:/etc/puppetlabs/puppet/data# touch common.yaml networking.yaml packages.yaml sensu.yaml users.yaml nodes/bootstrap.infra.skyhigh.iik.ntnu.no
root@bootstrap:/etc/puppetlabs/puppet/data# git init .
Initialized empty Git repository in /etc/puppetlabs/puppet/data/.git/
root@bootstrap:/etc/puppetlabs/puppet/data# git add .
root@bootstrap:/etc/puppetlabs/puppet/data# git commit -m "Initial import"