Skip to content

Instantly share code, notes, and snippets.

@aussielunix
Created May 11, 2012 08:07
Show Gist options
  • Save aussielunix/2658277 to your computer and use it in GitHub Desktop.
Save aussielunix/2658277 to your computer and use it in GitHub Desktop.
bundler-puppet

puppet & bundler - pundler

To manage puppet modules on a per project basis in a simple fashion.
Pretty much a carbon copy of how bundler + rubygems works in ruby projects.
Make use of a puppet module flavoured Gemfile
see below for example

bundle install --path modules

Some duck punching is needed for this to work.
Without duck punching this installs the modules in to modules/ruby/1.8/bundler/gems/puppetlabs-stdlib-11156fd29a6c

I have applied my nasty hacks inline to my fork of bundler
@rodjek is working on a neater set of bundler dsl extensions to do the same. bundler-puppet aka pundler
A test puppet appliance is available for testing this POC out.

TODO

  • remove / move cache dir from modules/
  • detect if module already exists and prompt to overwrite / update via git
  • allow Gemfile to include a mix of puppet modules + rubygems and detect the different types

Current

gem 'stdlib', :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git"
gem 'apt', :git => "https://github.com/puppetlabs/puppet-apt.git"
gem 'mongodb', :git => "https://github.com/puppetlabs/puppetlabs-mongodb.git"

Future - wishlist

# tell bundler we are working with puppet modules
:type puppet

# versions = git tags ?
gem 'stdlib', '0.0.1', :git => "https://github.com/puppetlabs/puppetlabs-stdlib.git"
gem 'apt', '0.0.1', :git => "https://github.com/puppetlabs/puppet-apt.git"
gem 'mongodb', '0.0.1', :git => "https://github.com/puppetlabs/puppetlabs-mongodb.git"

#tell bundler we are working with rubygems
:type rubygems

gem 'puppet-lint'
gem 'puppet', '>=2.7    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment