Years ago there were a lot of docs about how to setup Puppet to allow 
someone to build modules outside having to have a master/client setup using 
puppet apply. 

I am trying to figure out the very cryptic world of spec/rspec, as it seems 
to not be documented very well anywhere for anyone other than someone that 
already knows it, In doing so I don't want to be able to develop in my home 
directory in a server versus having to develop modules and test with rspec 
against a full puppet server configuration. 

So far I have found little bits and pieces around, but nothing definitive 
or documented well for building something of this nature. The best I found 
so far were pre-built Ubuntu Docker containers or Vagrant builds. I don't 
have access to either presently or the time to build out a server to handle 
hosting either. 

Does anyone have a guide to setting up a stand-alone puppet client for 
development.  There used to be a rspec-puppet.com/setup page and that is 
what is linked from inside the documentation, but the page is gone. 

What I have so far is: 

1. .Install puppet-agent to the host as root. 
2. Setup paths to use the Ruby configuration from the puppet-agent so that 
the any gem add-ons are compatible with the version of the puppet-agent 
RPM. 
3. Install puppetlabs-stdlib, rspec-puppet and any dependencies they 
require. 

When I have done a puppet module generate <name> and a rspec-puppet-init, I 
create a basic test to ensure the module compiles, as noted on the 
rspec-puppet Github page https://github.com/rodjek/rspec-puppet, That fails 
saying it can find compile. 

describe 'mymodule' do 
   it { is_expected.to compile } 
end 

Any other tests that "should" work don't. either. 

So in modules/test/manifests/init.pp I have:
class test {
   package { 'somepackage': 
        ensure => present,
  }
}

And my modules/test/spec/class/init_spec.rb has 

require 'spec_helper' 

describe 'test' do
    it { is_expected.to contain('somepackage').with_ensure('present')
end

So since this seems to be non-functional in my puppet development 
environment, which is a copy of my prod, I want to set it up fresh. When I 
tried in my home directory all i got were errors. 

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/23805142-d49e-4612-9590-472ab581dade%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to