can't find node definition puppet 3.7.1

430 views
Skip to first unread message

Tim Dunphy

unread,
Sep 27, 2014, 5:52:16 PM9/27/14
to puppet...@googlegroups.com
Hello,

When I tried adding a node to my puppet server running puppet 3.7.1 (on both server and the client) I'm getting an error stating that puppet can't find the node definition:

Warning: Unable to fetch my node definition, but the agent run will continue:

Warning: Error 400 on SERVER: Failed to find ops.mydomain.com via exec: Execution of '/etc/puppet/node.rb ops.mydomain.com' returned 1:

Info: Retrieving pluginfacts

Info: Retrieving plugin

Info: Loading facts

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ops.mydomain.com: Failed to find ops.mydomain.com via exec: Execution of '/etc/puppet/node.rb ops.mydomain.com' returned 1:

Warning: Not using cache on failed catalog

Error: Could not retrieve catalog; skipping run

I have a nodes manifest from an earlier version of puppet (version 3.4.3) tht used to work well that I tried to include in this version of puppet. 


Based on the above error I tried to include the nodes.pp file like this from within the /etc/puppet/node.rb like this.


require 'etc'

require 'net/http'

require 'net/https'

require 'fileutils'

require 'timeout'

include 'manifests/nodes.pp'


And the nodes.pp file is where I said in the node.rb config:


[root@puppet puppet]# ls -l manifests/nodes.pp

-rw-r--r--. 1 root root 4227 Sep 27 17:26 manifests/nodes.pp


And I'm still getting the error I show you above. The thought occurred to me that I don't really recognize the format of the node.rb file. Is this new? It doesn't seem like you would enter your node definitions into this file.


I also tried including my nodes.pp file by including it in the site.pp file like this:

[root@puppet puppet]# cat manifests/site.pp

# Empty site.pp required (puppet #15106, foreman #1708)

include 'nodes.pp'


And when I tried to add the puppet client I saw this error after doing a puppet agent --test --waitforcert 60 


Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find class nodes.pp for ops.mydomain.com on node ops.mydomain.com

Warning: Not using cache on failed catalog

Error: Could not retrieve catalog; skipping run


Thanks for any clarification you can provide!


Tim




--
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B

Benjamin Priestman

unread,
Sep 30, 2014, 4:29:23 AM9/30/14
to puppet...@googlegroups.com
I've always used import, not include to get my node definitions into site.pp. the new way of doing it, I believe, is to use a manifest directory. See https://docs.puppetlabs.com/puppet/latest/reference/lang_import.html

Tim Dunphy

unread,
Sep 30, 2014, 9:05:55 AM9/30/14
to puppet...@googlegroups.com
I've always used import, not include to get my node definitions into site.pp. the new way of doing it, I believe, is to use a manifest directory. See https://docs.puppetlabs.com/puppet/latest/reference/lang_import.html


Cool! Thanks I'll give that a try. I actually tried it before without success. But I'll give it another go and see where that gets me. 

Thanks,
Tim 

On Tue, Sep 30, 2014 at 4:29 AM, Benjamin Priestman <benj...@miniverse.me.uk> wrote:
I've always used import, not include to get my node definitions into site.pp. the new way of doing it, I believe, is to use a manifest directory. See https://docs.puppetlabs.com/puppet/latest/reference/lang_import.html

--
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/c47e599b-71e7-42df-b6c1-2543e2caf5f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jcbollinger

unread,
Sep 30, 2014, 9:35:21 AM9/30/14
to puppet...@googlegroups.com


On Tuesday, September 30, 2014 3:29:23 AM UTC-5, Benjamin Priestman wrote:
I've always used import, not include to get my node definitions into site.pp. the new way of doing it, I believe, is to use a manifest directory. See https://docs.puppetlabs.com/puppet/latest/reference/lang_import.html


Yes. 'include' is for declaring classes; it does not apply directly to whole manifests.  'import'ing node definitions is about the only use of 'import' that is any more accepted as good practice.  The point of the new(ish) "manifest directory" feature seems primarily to remove any need for that use of 'import'.  Deprecation of 'import' will surely follow, if it hasn't been deprecated already.


John

jcbollinger

unread,
Sep 30, 2014, 9:41:07 AM9/30/14
to puppet...@googlegroups.com


On Saturday, September 27, 2014 4:52:16 PM UTC-5, bluethundr wrote:
Hello,

When I tried adding a node to my puppet server running puppet 3.7.1 (on both server and the client) I'm getting an error stating that puppet can't find the node definition:

Warning: Unable to fetch my node definition, but the agent run will continue:

Warning: Error 400 on SERVER: Failed to find ops.mydomain.com via exec: Execution of '/etc/puppet/node.rb ops.mydomain.com' returned 1:

Info: Retrieving pluginfacts

Info: Retrieving plugin

Info: Loading facts

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node ops.mydomain.com: Failed to find ops.mydomain.com via exec: Execution of '/etc/puppet/node.rb ops.mydomain.com' returned 1:

Warning: Not using cache on failed catalog

Error: Could not retrieve catalog; skipping run

I have a nodes manifest from an earlier version of puppet (version 3.4.3) tht used to work well that I tried to include in this version of puppet. 


Based on the above error I tried to include the nodes.pp file like this from within the /etc/puppet/node.rb like this.



By its name and apparent use, node.rb is an external node classifier program, written in Ruby.  It is not a Puppet manifest, so the Puppet DSL documentation does not apply to it.

It may be that you want instead to modify /etc/puppet/manifests/site.pp, but given that there is an ENC in the picture, you really ought to get a grip on how your nodes are being classified before deciding how best to add a new one.


John

Henrik Lindberg

unread,
Oct 1, 2014, 1:19:36 PM10/1/14
to puppet...@googlegroups.com
It is already deprecated, and you get an error if you try to use import
with --parser future. In Puppet 4.0, the import is gone, but you get a
specific error message that it has been discontinued.

- henrik
--

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

Reply all
Reply to author
Forward
0 new messages