On 19 July 2017 at 00:51, James Perry <[email protected]> wrote:

> 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.
>

The whole point of rspec is to not require a puppetserver for testing. You
can read more on the newly updated rspec-puppet tutorial at
http://rspec-puppet.com/tutorial/ .

If you need a development environment, we released a development kit
preview last week (
https://groups.google.com/d/msg/puppet-users/_G6issIdmVY/5oUfKhwkAQAJ )
that you might want to check out to get all the tools with a single
installer.

Would love to hear how you got along with either!

Cheers, David

>
> 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 [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/puppet-dev/23805142-d49e-4612-9590-472ab581dade%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-dev/23805142-d49e-4612-9590-472ab581dade%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CALF7fHYL8%3DxK-vN-cTbiGcPJGvBFWBDsO9%3D-%2B8WfiXH2j52iew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to