Ask Your Question
0

Separating production and development environments

asked 2016-08-21 13:00:54 -0500

kartikv gravatar image

I have I think three different ways to accomplish this:

1)Hiera and custom fact, custom fact depends if it is PRD or DEV, hiera works using custom fact. 2)Install a new environment called DEV on puppetmaster, add agents in an agent-specified environment node group belonging to the DEV environment. 3)Modify puppet.conf on the agents by specifying the environment.

Please advise if all these methods are correct.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2016-08-23 06:08:34 -0500

Emerson Prado gravatar image

This all seems OK. My 2-cent: I recommend using groups, as opposed to custom facts or changing puppet.conf. Making the environment selection centralized is safer and easier to mantain.

edit flag offensive delete link more
0

answered 2016-08-22 04:24:06 -0500

rajeevsharma gravatar image

Hi Kartik,

You can setup your environment the way you mentioned in the steps. The basic idea here is to keep your dev and production environment separate. As an other option:

  1. Create a directory dev (next to production) on your puppet master.
  2. As soon as dev appears on PE console, create a new node group "Development", keeping parent name as "Production environment" and set environment as dev.
  3. No need to edit puppet.conf on agent node as the default environment production will be overridden by dev environment.
  4. You can use $environment variable in hiera or in code to decide environment at runtime instead of defining the custom factors. Though, there's no harm in defining the custom facts for this purpose.

I hope this will help in setting up your environment.

edit flag offensive delete link more

Comments

I tried it but it does not seem to work: http://pastebin.com/bif8MKrw

kartikv gravatar imagekartikv ( 2016-08-24 06:45:47 -0500 )edit
0

answered 2016-08-24 07:32:43 -0500

kartikv gravatar image

Thanks Team, my bad, I did not update the site.pp in the development environment: /etc/puppetlabs/code/environments/development/manifests/site.pp for hiera

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-08-21 13:00:54 -0500

Seen: 93 times

Last updated: Aug 24 '16