xorpaul / g10k

my r10k fork in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: Puppetfile - module link support

bkuebler opened this issue · comments

If you create environments like "production/development/staging/testing" and so on it would be a nice feature to link these environment branches again your puppet module branches. For example:

Environment "production" <=> Environment branch "production" <=> Module branch "production"

The default solution to do this is to have different "Puppetfile" configuration in your environments:

Puppetfile (production)

mod 'awesomemodule',
  :git => 'http://github.com/foo/bar.git',
  :branch => 'production'

Puppetfile (development)

mod 'awesomemodule',
  :git => 'http://github.com/foo/bar.git',
  :branch => 'development'

But in this scenario you will loose the nice git workflow for merge between the environments. Because each Puppetfile is different and if you would like to use your puppet environments as real Changemanagement stages for example:

Do puppet changes in development environment => merge these changes to testing/staging environment => merge testing/staging environment into production.

So a solution to get this working is support i called it "module link support". The Puppetfile could be looks like this:

mod 'awesomemodule',
  :git => 'http://github.com/foo/bar.git',
  :link => 'true'

So each Puppetfile in environments is the same, but the used module in each environment is on different branch with the same name of the environment branch.

I'll send you a merge request for this feature in the next time.

regards Benjamin