We started using dynamic environments
in November. Some of our manifests are sensitive and my employer's
policy forbids us from storing this type of information in any
kind of third-party service, so I built my own Gitlab server. I
wrote a brief note on how to do this on my employer's blog:
http://unix.bris.ac.uk/2014/11/17/building-a-gitlab-server-with-puppet/
I thought I'd also written a blog post about puppet-sync but
apparently I didn't, so I'll say a few words about that here. We
are using the pdxcat/puppet-sync which is installed to the gitlab
server in /usr/local/bin. Gitlab provides a way of using web hooks
through the GUI but not "proper" git hooks, so you have to fiddle
in the filesystem. I configured public keys and installed the
post-receive hook in:
/var/opt/gitlab/git-data/repositories/<user>/<repo>.git/hooks/post-receive
... which references puppet-sync. Now, every time something is
pushed to a branch in Gitlab, the gitlab server ssh's to the
puppet master and pulls that branch into /etc/puppet/environments.
Now all the developers can make their own branches/environments
without affecting production. The solution works well for us.
You would only be able to do this with Bitbucket if they allow you
to configure git hooks. We are currently looking at how to switch
to web hooks instead of git hooks. This would allow us to use
Gitlab more easily, and to use Github or Bitbucket. I think we
would need to write a simple web-based API that runs on the puppet
master to receive the web hooks and act upon them.
Cheers,
Jonathan