Custom Types not being loaded correctly?

61 views
Skip to first unread message

Gavin Williams

unread,
Mar 5, 2013, 6:56:26 AM3/5/13
to puppe...@googlegroups.com
Morning all

Not sure if this is a bug, or just a configuration issue in the way I'm using it...

Anyhow, I'm doing some work on one of my NetApp type/provider to add additional properties etc...
As part of this, I've created a new copy of my module in a 'test' environment folder as follows:

Puppet.conf:
    modulepath = /etc/puppet/environments/$environment/modules:/etc/puppet/modules

Folder structure:
-bash-4.1$ pwd
/etc/puppet
-bash-4.1$ ls -l environments/test/modules/
total 8
drwxr-xr-x. 6 puppet puppet 4096 Mar  4 15:41 fatmcgav-netapp
-bash-4.1$

The provider functionality loads correctly from this folder, however it would appear that the type definitions are still loading from the main module dir...
E.g.:
-bash-4.1$ pwd
/etc/puppet/environments/test/modules/fatmcgav-netapp
-bash-4.1$ diff /etc/puppet/modules/fatmcgav-netapp/lib/puppet/type/netapp_export.rb lib/puppet/type/netapp_export.rb
45d44
<
46a46,53
>   newproperty(:readonly) do
>     desc "Export read-only hosts."
>   end
>
>   newproperty(:readwrite) do
>     desc "Export read-write hosts."
>   end
>
-bash-4.1$
-bash-4.1$ ./node.rb actint-star-nactl01
---
  environment: test
  parameters:
    foreman_env: test
    root_pw: xybxa6JUkz63w
    puppetmaster: puppet
  classes: {}
-bash-4.1$ sudo puppet device --deviceconfig devices/actint-star-nactl01.conf -v
Info: starting applying configuration to actint-star-nactl01 at actint-star-nactl01
Warning: Local environment: "production" doesn't match server specified node environment "test", switching agent to "test".
Info: Retrieving plugin
Info: Caching catalog for actint-star-nactl01
Error: Failed to apply catalog: Invalid parameter readonly
-bash-4.1$
-bash-4.1$ diff /etc/puppet/modules/fatmcgav-netapp/lib/puppet/type/netapp_export.rb lib/puppet/type/netapp_export.rb
-bash-4.1$ sudo service puppetmaster restart                                                                      
Stopping puppetmaster:                                     [  OK  ]
Starting puppetmaster:                                     [  OK  ]
-bash-4.1$
-bash-4.1$ sudo puppet device --deviceconfig devices/actint-star-nactl01.conf -v
Info: starting applying configuration to actint-star-nactl01 at actint-star-nactl01
Info: Retrieving plugin
Info: Caching catalog for actint-star-nactl01
Info: Applying configuration version '1362484381'
Notice: /Stage[main]//Node[actint-star-nactl01]/Netapp_export[/vol/v_puppet_test20122012/q_puppet_test20122012]/readonly: defined 'readonly' as 'all_hosts'
Notice: Finished catalog run in 1.18 seconds
-bash-4.1$

Thoughts?

Regards
Gavin


devon

unread,
Mar 7, 2013, 1:23:28 PM3/7/13
to puppe...@googlegroups.com
I recall running into similar issues. I'm pretty sure that using apache/passenger removed the need to restart the puppet master process, but there was still a requirement of having the types/providers in the master's module dir.

Although, a quick search turned up http://projects.puppetlabs.com/issues/13858 - which looks to have solved the later issue.

-devon

Nan Liu

unread,
Mar 7, 2013, 4:33:25 PM3/7/13
to puppet-dev
On Thu, Mar 7, 2013 at 10:23 AM, devon <devon....@gmail.com> wrote:
I recall running into similar issues. I'm pretty sure that using apache/passenger removed the need to restart the puppet master process, but there was still a requirement of having the types/providers in the master's module dir.

Although, a quick search turned up http://projects.puppetlabs.com/issues/13858 - which looks to have solved the later issue.

Trying to use a custom type/provider is one thing, trying to use two different versions of a custom type/provider for development in two environment brings a whole other set of problems.

Regarding the original issue, don't use environments for this workflow, you need another instances of the master running on a different port or server. 

Nan

fatmcgav

unread,
Mar 7, 2013, 4:39:16 PM3/7/13
to puppe...@googlegroups.com

Nan

Cheers for confirming, I kinda guessed as much...

Would it work if the module wasn't installed in the main lib dir, but in the environment specific dirs?

Cheers
Gav

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-dev/yPb8FxEbIoM/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to puppet-dev+...@googlegroups.com.
To post to this group, send email to puppe...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Andy Parker

unread,
Mar 11, 2013, 5:41:27 PM3/11/13
to puppe...@googlegroups.com
On Thu, Mar 7, 2013 at 1:39 PM, fatmcgav <fatm...@gmail.com> wrote:
> Nan
>
> Cheers for confirming, I kinda guessed as much...
>
> Would it work if the module wasn't installed in the main lib dir, but in the
> environment specific dirs?
>

No, there is a limitation in the way code gets loaded that makes
environments not suited to keeping different implementations in
different environments. To be safe and predictable you'll need to have
different masters for each environment.
> 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

Erik Dalén

unread,
Mar 12, 2013, 9:26:32 AM3/12/13
to Puppet Developers
On Mar 11, 2013 10:41 PM, "Andy Parker" <an...@puppetlabs.com (mailto:an...@puppetlabs.com)> wrote:
> On Thu, Mar 7, 2013 at 1:39 PM, fatmcgav <fatm...@gmail.com (mailto:fatm...@gmail.com)> wrote:
> > Nan
> >
> > Cheers for confirming, I kinda guessed as much...
> >
> > Would it work if the module wasn't installed in the main lib dir, but in the
> > environment specific dirs?
> >
>
> No, there is a limitation in the way code gets loaded that makes
> environments not suited to keeping different implementations in
> different environments. To be safe and predictable you'll need to have
> different masters for each environment.
>
Or you could do some configuration so each worker process only does one compilation.

Which would involve splitting compilations and other requests like file_metadata to different pools of worker processes, the latter taking more then one request.

I haven't implemented this myself, but thinking about doing it soon.

Even having one master per environment isn't safe as some code isn't reloaded when it changes, for example functions.

>
> > Cheers
> > Gav
> >
> > On Mar 7, 2013 9:34 PM, "Nan Liu" <nan...@gmail.com (mailto:nan...@gmail.com)> wrote:
> >>
> >> On Thu, Mar 7, 2013 at 10:23 AM, devon <devon....@gmail.com (mailto:devon....@gmail.com)> wrote:
> >>>
> >>> I recall running into similar issues. I'm pretty sure that using
> >>> apache/passenger removed the need to restart the puppet master process, but
> >>> there was still a requirement of having the types/providers in the master's
> >>> module dir.
> >>>
> >>> Although, a quick search turned up
> >>> http://projects.puppetlabs.com/issues/13858 - which looks to have solved the
> >>> later issue.
> >>
> >>
> >> Trying to use a custom type/provider is one thing, trying to use two
> >> different versions of a custom type/provider for development in two
> >> environment brings a whole other set of problems.
> >>
> >> Regarding the original issue, don't use environments for this workflow,
> >> you need another instances of the master running on a different port or
> >> server.
> >>
> >> Nan
> >>
> >> --
> >> You received this message because you are subscribed to a topic in the
> >> Google Groups "Puppet Developers" group.
> >> To unsubscribe from this topic, visit
> >> https://groups.google.com/d/topic/puppet-dev/yPb8FxEbIoM/unsubscribe?hl=en.
> >> To unsubscribe from this group and all its topics, send an email to
> >> puppet-dev+...@googlegroups.com (mailto:puppet-dev%2Bunsu...@googlegroups.com).
> >>
> >> To post to this group, send email to puppe...@googlegroups.com (mailto:puppe...@googlegroups.com).
> >> Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >>
> >
> > --
> > 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+...@googlegroups.com (mailto:puppet-dev%2Bunsu...@googlegroups.com).
> > To post to this group, send email to puppe...@googlegroups.com (mailto:puppe...@googlegroups.com).
> > Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
> > For more options, visit https://groups.google.com/groups/opt_out.
> >
> >
>
> --
> 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+...@googlegroups.com (mailto:puppet-dev%2Bunsu...@googlegroups.com).
> To post to this group, send email to puppe...@googlegroups.com (mailto:puppe...@googlegroups.com).
Reply all
Reply to author
Forward
0 new messages