Puppet 5 tests of forked module gives errors

42 views
Skip to first unread message

jmp242

unread,
Feb 16, 2018, 3:42:35 PM2/16/18
to Puppet Users
So I originally conflated 2 different issues, and the one was fixed with the bugfix referenced in my previous thread. So this one is still happening.

I have an updated module to test (a forked reboot module) which I have deployed in my dev environment and code to use the new parameter, however when I try and apply the manifest I get errors - again 500 on server, this time that the new parameter doesn't exist. I'm wondering if this is also an issue with pluginsync or something like that so the client doesn't see the new module?

So it was suggested that I needed environment isolation per: https://puppet.com/docs/puppet/5.3/environment_isolation.html

I tried it and got:
puppet generate types --environment production
Notice: No custom types were found.


puppet generate types --environment dev
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in `get!': Could not find a directory environment named 'dev' anywhere in the path: /etc/puppetlabs/code. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in `
push_application_context'
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:346:in `run'

       
from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
        from /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `
execute'
        from /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

So:
ll /etc/puppetlabs/code
total
0
drwxr
-xr-x 4 root root 35 Nov  2 04:12 environments
drwxr
-xr-x 2 root root  6 Nov  2 04:12 modules
drwxr
-xr-x 3 root root 29 Feb 16 15:33 production

Now all our modules are in what used to be called directory environments, as sub directories of environments.
ll /etc/puppetlabs/code/production/
total
0

ll
/etc/puppetlabs/code/environments/
total
0
drwxr
-xr-x 4 root root 38 Nov 15 15:43 dev
drwxr
-xr-x 6 root root 93 Dec 21 11:36 production


So I'm pretty confused how to fix all of this.

David Schmitt

unread,
Feb 19, 2018, 7:51:24 AM2/19/18
to puppet...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/553bda68-7d45-447e-b4fd-890af7ce47df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

jmp242

unread,
Feb 19, 2018, 8:36:10 AM2/19/18
to Puppet Users
I've been on that page, but it doesn't really tell me what to do. I'm not using r10k, nor pe. I don't have a .resource_types directory probably because I can't get the isolation to do anything.

David Schmitt

unread,
Feb 20, 2018, 5:31:48 AM2/20/18
to puppet...@googlegroups.com
Apologies, I linked you to the wrong section in that document. You need to run puppet generate types --environment <ENV_NAME> for each of your environments. For example, to generate metadata for your production environment, run: puppet generate types --environment production. And you need to run this every time you deploy new code to your master.

Cheers, David


For more options, visit https://groups.google.com/d/optout.

Henrik Lindberg

unread,
Feb 20, 2018, 11:27:19 AM2/20/18
to puppet...@googlegroups.com
On 19/02/18 14:36, jmp242 wrote:
> I've been on that page, but it doesn't really tell me what to do. I'm
> not using r10k, nor pe. I don't have a |.resource_types directory
> pro|bably because I can't get the isolation to do anything.

Probably. The .resource_types is created if needed by the command
if there are something to write.

Check that your environments are where you expect them to be and that
they have the correct modulepath and that all modules are where they are
supposed to be.
You could experiment with the setting for environmentpath (one or
several directories that puppet will search for environment directories).

Best,
- henrik

> On Monday, February 19, 2018 at 7:51:24 AM UTC-5, David Schmitt wrote:
>
> Have a look at
> https://puppet.com/docs/puppet/5.3/environment_isolation.html#generate-types
> <https://puppet.com/docs/puppet/5.3/environment_isolation.html#generate-types>
> and the surrounding docs.
>
> On Fri, Feb 16, 2018 at 8:42 PM jmp242 <jp1...@gmail.com
> <javascript:>> wrote:
>
> So I originally conflated 2 different issues, and the one was
> fixed with the bugfix referenced in my previous thread. So this
> one is still happening.
>
> I have an updated module to test (a forked reboot module) which
> I have deployed in my dev environment and code to use the new
> parameter, however when I try and apply the manifest I get
> errors - again 500 on server, this time that the new parameter
> doesn't exist. I'm wondering if this is also an issue with
> pluginsync or something like that so the client doesn't see the
> new module?
>
> So it was suggested that I needed environment isolation per:
> https://puppet.com/docs/puppet/5.3/environment_isolation.html
> <https://puppet.com/docs/puppet/5.3/environment_isolation.html>
>
> I tried it and got:
> |
> puppet generate types --environment production
> Notice:Nocustom types were found.
> |
>
>
> |
> puppet generate types --environment dev
> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/environments.rb:38:in`get!':
> Could not find a directory environment named 'dev' anywhere in
> the path: /etc/puppetlabs/code. Does the directory exist?
> (Puppet::Environments::EnvironmentNotFound)
>         from
> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application_support.rb:29:in
> `push_application_context'
>         from
> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:346:in
> `run'
> from/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in`run'
>         from
> /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in
> `execute'
>         from /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'
> |
>
> So:
> |
> ll /etc/puppetlabs/code
> total 0
> drwxr-xr-x 4root root 35Nov204:12environments
> drwxr-xr-x 2root root 6Nov204:12modules
> drwxr-xr-x 3root root 29Feb1615:33production
> |
>
> Now all our modules are in what used to be called directory
> environments, as sub directories of environments.
> |
> ll /etc/puppetlabs/code/production/
> total 0
>
> ll /etc/puppetlabs/code/environments/
> total 0
> drwxr-xr-x 4root root 38Nov1515:43dev
> drwxr-xr-x 6root root 93Dec2111:36production
>
> |
>
> So I'm pretty confused how to fix all of this.
>
> --
> You received this message because you are subscribed to the
> Google Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to puppet-users...@googlegroups.com <javascript:>.
> <https://groups.google.com/d/msgid/puppet-users/553bda68-7d45-447e-b4fd-890af7ce47df%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> Cheers, David
>
> https://twitter.com/dev_el_ops
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/fbe255a3-4830-4b1e-aeee-b4a32fc7c786%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/fbe255a3-4830-4b1e-aeee-b4a32fc7c786%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Reply all
Reply to author
Forward
0 new messages