Table of Contents

puppet environments

master

Inspired by the guides above a dynamic approach for the puppet.conf on the master might look like:

puppet.conf
[main]
  server=puppetmaster.example.com
  logdir=/var/log/puppet
  vardir=/var/lib/puppet
  ssldir=/var/lib/puppet/ssl
  rundir=/var/run/puppet
  factpath=$vardir/lib/facter
  templatedir=$confdir/templates

[master]
  certname=puppetmaster.example.com
  dns_alt_names=puppetmaster.example.de
  ssl_client_header = SSL_CLIENT_S_DN
  ssl_client_verify_header = SSL_CLIENT_VERIFY

  modulepath = $confdir/env/$environment/modules:$confdir/modules
  manifest   = $confdir/manifests/unknown_environment.pp

[production]
  manifest   = $confdir/manifests/site.pp

[dev]
  manifest   = $confdir/manifests/site.pp

The alternative could be a static definition of paths per environment:

puppet.conf
[main]
  server=puppetmaster.example.com
  logdir=/var/log/puppet
  vardir=/var/lib/puppet
  ssldir=/var/lib/puppet/ssl
  rundir=/var/run/puppet
  factpath=$vardir/lib/facter
  templatedir=$confdir/templates

[master]
  certname=puppetmaster.example.com
  dns_alt_names=puppetmaster.example.de
  ssl_client_header = SSL_CLIENT_S_DN
  ssl_client_verify_header = SSL_CLIENT_VERIFY

[production]
  manifest   = $confdir/manifests/site.pp
  modulepath = $confdif/modules
  
[test]
  manifest   = /etc/puppet/env/test/manifests/site.pp
  modulepath = /etc/puppet/env/test/modules
  
[dev]
  manifest   = /etc/puppet/env/dev/manifests/site.pp
  modulepath = /etc/puppet/env/dev/modules

agent

Add your client to the test environment:

[main]
  server=puppetmaster.example.com
  environment = test
  logdir=/var/log/puppet
  vardir=/var/lib/puppet
  ssldir=/var/lib/puppet/ssl
  rundir=/var/run/puppet
  factpath=$vardir/lib/facter
  templatedir=$confdir/templates
networking/puppet/environments.txt · Last modified: 2012-03 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready