James,

If the modules are in your modulepath and environments are defined in
puppet.conf, you can actually use puppet apply to declare classes from the
command line.  For example, if you just wanted to test the nginx::config
class you could run:  puppet apply -v -e 'include nginx::config'   This
(specifically the -e flag with the code you want to pass in quotes) allows
you to 'test' a specific class out-of-band from your regular Puppet runs.
 DO NOTE, HOWEVER, that 'test' in this sense means that it will ACTUALLY
DECLARE THE CLASS AND PERFORM THE ACTION!  If this is not what you want,
you'll still need to add the --noop flag to SIMULATE the code.  You can
also create individual files in your modules 'tests' directory and declare
them with puppet apply too (if you need more than just one line to test
your code - a la Defined Resource Types).  Note that you can ALSO pass the
environment from the command line with '--environment test'.

Does this help?


On Thu, Apr 12, 2012 at 7:00 AM, James Patterson <
jamespatter...@operamail.com> wrote:

> Hello,
>
> I have a production puppet environment that is working well.
>
> Now more people are developing modules for it we are using a test
> environment using environment=test in the puppet.conf file.
> This prevents changes to modules in the production environment being
> affected by changes in the test environment. So far so good.
>
> By module I mean class, in case it's the wrong class.
>
> 1. I need to test a change to a single module on a production server,
> without breaking all other production servers.
> I could put this single production server into the test environment, but
> this has the danger of pulling in changes from other people's modules as
> well.
> Should I create yet another environment to do this?
>
> 2. Can I define certain modules as being taken from another environment,
> the "test" environment, for example?
>
> Thanks in advance,
>
> --
>  James Patterson
>  jamespatter...@operamail.com
>
> --
> http://www.fastmail.fm - Same, same, but different...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>


-- 

Gary Larizza
Professional Services Engineer
Puppet Labs

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to