Ask Your Question
0

Puppet agent apply default configuration but doesn't apply node configuration

asked 2015-10-15 04:17:04 -0500

link0876 gravatar image

updated 2015-10-15 11:38:17 -0500

ramindk gravatar image

Puppet master version: 3.3.1

Puppet agent version: 3.3.1

Content of site.pp

import '*/*.pp'
node default {
include 'auth'
}

In the folder where site.pp is located there is folder called 'VirtualMachines' In 'VirtualMachines' folder there is file called: server1_mycompany_com.pp

Content of file server1_mycompany_com.pp

node 'server1.mycompany.com' inherits 'default' {
include 'zabbix::agent'
}

The problem is that when running

puppet agent --test

on server1.mycompany.com only module from default configuration is applied, which is called auth. Module from node configuration, which is called zabbix-agent is not applied.

Is anything wrong with site.pp? Other nodes works ok and apply configuration both from default section and from nodes section.

edit retag flag offensive close merge delete

Comments

Have you checked the clientcert name on that machine? Node names in puppet map to the agent's ssl cert name. This defaults to the hostname at the time the cert is created (first agent run). If you changed the hostname after the first puppet run, they may not match.

lavaman gravatar imagelavaman ( 2015-10-15 19:07:18 -0500 )edit

I check cert name on client by entering directory /var/lib/puppet/ssl/certs/ and it matches the name that is on puppet master by running command puppet cert list -all. When I run puppet agent --test --debug - where is the section of applying node configuration?

link0876 gravatar imagelink0876 ( 2015-10-16 02:05:31 -0500 )edit

if you copy the content of server1_mycompany_com.pp in site.pp, do you see the same result? If yes, then the name of the node is not correct.

alexandre gravatar imagealexandre ( 2015-10-16 04:47:08 -0500 )edit

The problem somehow disappeared and is no longer reproducible. Possible running of sudo `puppet master SIGHUP` helped. If the problem will appear again on other nodes I'll let you know.

link0876 gravatar imagelink0876 ( 2015-10-16 06:50:29 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2015-10-19 08:00:47 -0500

link0876 gravatar image

updated 2015-10-19 11:53:24 -0500

ramindk gravatar image

I think I finally found the cause of the problem.

The statement import nodes/*.pp is only expanded when the server starts. If you add a new node definition, you'll need to restart your master. Modifying existing ones do not requires a restart.

How to restart puppet master:

# if running your Puppet master via Apache
sudo service httpd restart # or apache2 on Debian based OS

# if using the single process testing instance
sudo service puppetmaster restart
edit flag offensive delete link more

Comments

You can also "touch" the site.pp file if you don't want to restart the server: https://docs.puppetlabs.com/guides/troubleshooting.html#why-hasnt-my-new-node-configuration-been-noticed

GregLarkin gravatar imageGregLarkin ( 2015-10-19 14:32:45 -0500 )edit

I faced that problem again and discovered that restarting puppet master by running regular commands do not help. But touching site.pp with touch command works and possibly killing puppet master process also works

link0876 gravatar imagelink0876 ( 2015-11-06 02:21:59 -0500 )edit
0

answered 2015-10-16 04:28:22 -0500

czerwe gravatar image

Did you already removed the iheritance form you node? puppetlabs recommence NOT to use inheritance. I dont know why but maybe you running in an problem with that. Simply remove the inheritance and check if it gets the zabbix class applied. If this solves it you can switch to build an default class instead an default node.

You can also edit the zabbix module to pring an notify. So you can verify that he is really not executing it. If an notify is shown than you have an other problem.

The node name is case sesitive. Check with 'facter fqdn' if this is really matching your node name.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-10-15 04:17:04 -0500

Seen: 1,016 times

Last updated: Oct 19 '15