Ask Your Question

Dynamic Environment: git is putting too much info in the environment

asked 2013-01-15 15:37:03 -0500

thewellington gravatar image

I am setting up dynamic environments using Git... I am using the document at as a reference, and using the post-receive hook from the author's github repository

My git repository is managed by gitolite and is stores at /home/git/repositories/puppet-config.git My puppet configuration is in /etc/puppetlabs/puppet/ My environments are in /etc/puppetlabs/puppet/environments/

When I use git to branch the repository, a new directory is created at /etc/puppetlabs/puppet/environments/newbranch where newbranch is the name of the branch in the git repo.

First Issue ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-01-16 03:06:08 -0500

larstobi gravatar image

updated 2013-01-16 03:06:40 -0500

The point about checking out the branches in /etc/puppetlabs/puppet/environments/ is that you will be able to point two variables to directories in the branch: manifest and modulepath.

For example, pointing manifests to the manifest in the branch and moduledir to the modules directory in the branch will do this:

    manifest = /etc/puppet/environments/feature_pg/manifests/site.pp
    modulepath = /etc/puppet/environments/feature_pg/modules
    environment = feature_pg

Everything else in the checked out branch is ignored (unless you import something in site.pp).

It's not trivial to have git checkout only two directories from a branch. While ... (more)

edit flag offensive delete link more


OK... Let me ask it this way. 1. should git put a copy of /etc/puppetlabs/puppet inside /etc/puppetlabs/puppet/environments/environment_name?

thewellington gravatar imagethewellington ( 2013-01-16 11:32:18 -0500 )edit

... and 2. should git be doing this to the live configuration at /etc/puppetlabs/puppet? or should it be building the new environment at $REPO/puppet/environments/??

thewellington gravatar imagethewellington ( 2013-01-16 11:32:42 -0500 )edit

The answer to both question 1 and 2 is that doing these things is the job of the dynamic environment script which runs in the event of a git push.

larstobi gravatar imagelarstobi ( 2013-05-27 07:22:52 -0500 )edit

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


Asked: 2013-01-15 15:37:03 -0500

Seen: 352 times

Last updated: Jan 16 '13