On Thursday, August 27, 2015 at 3:47:44 PM UTC-5, Chuck Amadi wrote:
>
> Hi Folks,
>
> OK, so I digested node classification documentation to ensure my nodes 
> attempts can be classified using the correct node definitions as below:
>
> puppet.master # vi /etc/puppet/manifests/site.pp
>
> # site.pp file.
>
> -- sof --
>
> node default {
> }
>
> node 'chat.client.com', 'puppet.master.com' {    # applies to 
> puppet-client and puppet-master nodes
>   file {'/tmp/dns':    # resource type file and filename
>     ensure => present, # make sure it exists
>     mode => 0644,
>     content => "Only DNS servers get this file.\n",
>   }
> }
>
> -- eof --
>
> Then restarted the Puppet Master and run "puppet master --verbose 
> --no-daemonize". Even tried this  "puppet master --compile chat.client.com", 
> still nothing triggers catalogs for my node "chat.client.com".
>
>

I'm not sure what you mean be nothing "triggers" catalogs.

 

> puppet.master # puppet apply site.pp --noop
> Notice: Compiled catalog for puppet.master.com in environment production 
> in 0.16 seconds << no joy >>
> Notice: /Stage[main]/Main/Node[puppet]/File[/tmp/dns]/ensure: 
> current_value absent, should be present (noop)
> Notice: Node[puppet]: Would have triggered 'refresh' from 1 events
> Notice: Class[Main]: Would have triggered 'refresh' from 1 events
> Notice: Stage[main]: Would have triggered 'refresh' from 1 events
> Notice: Finished catalog run in 0.09 seconds
>
>

What "no joy"?  What did you hope would happen that didn't happen?

 

> puppet.master # puppet apply site.pp
> Notice: Compiled catalog for puppet.master.com in environment production 
> in 0.17 seconds
> Notice: /Stage[main]/Main/Node[puppet]/File[/tmp/dns]/ensure: created
> Notice: Finished catalog run in 0.13 seconds
> puppet.master # cat /tmp/dns 
> Only DNS servers get this file.
> puppet.master # vi /etc/puppet/manifests/site.pp
>
> Why does this only trigger on the master if I have two nodes declared ? in 
> the site.pp file.
>


What triggers only if you have two nodes declared?  The two "puppet apply" 
commands you just gave differ in that one uses "--noop".  Their results are 
consistent with each other.  I don't see the basis for your claim that 
behavior differs depending on how many nodes you have declared.

In any event, if your intention is to use a master / agent setup, then I 
urge you to stop messing around with "puppet apply".  It will not give you 
reliable information about how the master will respond to catalog requests 
from agents.  If you want the master to manage itself, then run the agent 
there.

 

> Is there method to force a creation for nodes catalogs.
>


The problem is not your agent failing to obtain a catalog from the master.  
The agent would complain if it could not retrieve a catalog, and it is not 
emitting such a complaint.  The problem, therefore, is with the contents of 
the catalog it does receive.

In any event, yes, but you already know "puppet master --compile".  Also, 
restarting the master, as I previously suggested, will ensure that each 
node's catalog is compiled freshly on the next request.


 

>
> I tried this on the master but nothing of interest below:
>
>  # puppet master --compile chat.client.com
>
> {
>   "document_type": "Catalog",
>   "data": {
>     "resources": [
>       {
>         "tags": ["stage"],
>         "type": "Stage",
>         "parameters": {
>           "name": "main"
>         },
>         "exported": false,
>         "title": "main"
>       },
>       {
>         "tags": ["class","settings"],
>         "type": "Class",
>         "exported": false,
>         "title": "Settings"
>       },
>       {
>         "tags": ["class"],
>         "type": "Class",
>         "parameters": {
>           "name": "main"
>         },
>         "exported": false,
>         "title": "main"
>       }
>     ],
>     "tags": ["settings"],
>     "classes": [
>       "settings"
>     ],
>     "version": 1440708265,
>     "edges": [
>       {
>         "target": "Class[Settings]",
>         "source": "Stage[main]"
>       },
>       {
>         "target": "Class[main]",
>         "source": "Stage[main]"
>       }
>     ],
>     "environment": "production",
>     "name": "chat.client.com"
>   },
>   "metadata": {
>     "api_version": 1
>   }
> }
>
>

And that is an empty catalog, or as empty as they come, at least.  It does 
not correspond to the site manifest you presented, so either you have a 
caching issue on the master, or the master is not consulting the given site 
manifest at all.  The latter might be the case if you are using directory 
environments 
<https://docs.puppetlabs.com/puppet/3.8/reference/environments.html>, 
depending on the configuration of environment "production" (the default 
environment, and the one to which your node is assigned per the above 
catalog), or if you have configured a different site manifest or site 
manifest directory in your puppet.conf.

Note also that Puppet looks for configuration in different places 
<https://docs.puppetlabs.com/puppet/3.8/reference/dirs_confdir.html> 
depending on its process UID and on command-line options.  In part for that 
reason, it is usually best to start the master via the appropriate service 
control tool.  On CentOS 6, that would probably mean "service puppetmaster 
start".  Supposing that you installed via a PL-provided RPM, it should have 
installed and registered the necessary initscript.


John

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e027aa39-8202-413d-9b75-c9359f5fac19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to