Ask Your Question

beaker and git modules

asked 2017-01-26 07:55:06 -0500

updated 2017-02-27 15:10:41 -0500

Complete newby with beaker-rspec.

How would I get a Git repo? Something like this:

hosts.each do |host|
      on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }

But with my own personal module.

This is a profile module that I pull with r10k, but I haven't seen anything online or here on the forums on how I would pull an entire control repo or install a Puppetfile and use that to pull all of my modules.

Update:Apparently this is already on the beaker's Jira board:

Read through the comments for Tim Hughes work-around at the bottom

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-01-31 15:42:48 -0500

This is how i have done it in my project.

This is the example from spec/acceptance/modulename_spec.rb.


  class { 'puppetserver::repository': } ->
    class { 'puppetserver':
      version => #{version},
      config  => {
        'java_args'     => {
          'xms'         => '256m',
          'xmx'         => '256m',
          'maxpermsize' => '512m',
    host { 'puppet':
      ip => '',
  include your_module
  class { 'your_user_defined_class': }

What you mentioned like the following would go into the spec/spechelperacceptance.rb:

  on host, puppet('module','install','puppetlabs-stdlib')
  on host, puppet('module','install','puppetlabs-concat')
  on host, puppet('module', 'install', 'camptocamp-puppetserver')
  on host, puppet('module', 'install', 'puppetlabs-inifile')
  on host, puppet('module', 'install', 'puppetlabs-puppetserver_gem')

There are lot of examples in the github for the same. Go through any of those and you should get a fair idea.

edit flag offensive delete link more

answered 2017-02-10 06:01:07 -0500

updated 2017-02-27 14:14:25 -0500

This is good, but this only assumes forge installed modules. To do this with a private repo, according to the Forge docs, you would need to duplicate their API.

We have a few wrapper modules that we keep locally and we need to pull them to test our profile. To achieve this, I've done the following:

on host, 'git clone /etc/puppet/modules/MY_MODULE_NAME'
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



Asked: 2017-01-26 07:55:06 -0500

Seen: 66 times

Last updated: Feb 27