Ask Your Question
0

Windows agent not reading changes to puppet.conf file [closed]

asked 2014-12-22 10:47:46 -0500

mckownam gravatar image

I've had this particular issue with two different windows VMs, one is Windows 2008 R2 and the other is Windows 7, both x64. I installed puppet via the exe installer, specifying the master, whose name is NOT 'puppet'. But when I run puppet in the command line and as a service, it will not connect to the master.

I tested what master it was looking for by entering "puppet agent -t --configprint server" and I always get 'puppet' in return.

I've specified the server in puppet.conf (C:\programData\puppetlabs\puppet\etc\puppet.conf) using something similar to the example below: example: [main] server = example.domain.com

But puppet refuses to read in this change. I know that it automatically and immediately reads in changes to puppet.conf in linux, but is there something that needs to be done to get the windows agents to reflect these changes? Specifying the server name in the command line works, but not in puppet.conf.

Note: Changing the name of the master to 'puppet' is not a desired solution since it does not solve whatever underlying issue there is with these two puppet agents/VMs.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by mckownam
close date 2015-01-07 07:39:21.713753

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-12-26 20:53:45 -0500

cbarbour gravatar image

But puppet refuses to read in this change. I know that it automatically and immediately reads in changes to puppet.conf in linux, but is there something that needs to be done to get the windows agents to reflect these changes? Specifying the server name in the command line works, but not in puppet.conf.

To the best of my knowledge, puppet.conf is re-read ever time an agent run begins. It would certainly be re-read when you invoke puppet agent -t on the command line.

Is there any chance Puppet isn't interpreting the configuration file you think it's interpreting? A common gotcha is that Puppet maintains per-user configuration files, and only reads the config file in ProgramData when invoked as an administrator.

An easy way to confirm that Puppet is running with the expected configuration is to invoke the puppet config face. Try puppet config print and check to make sure that config is what you expect it to be.

It's also good to invoke puppet with the --configprint option. Puppet permits you to use a different configuration depending on how it's invoked. E.g. you might get different results from puppet apply --configprint server and puppet agent --configprint server (I'm aware that this is a bit nonsensical in the case of puppet apply...)

Hopefully one of those suggestions will help you debug your problem.

edit flag offensive delete link more
0

answered 2015-01-07 07:37:32 -0500

mckownam gravatar image

I found the solution through some experimentation of my own. It does not mention this in the documentation, but if puppet is going to be run as a service in Windows, ONLY run it as administrator (run cmd.exe as Administrator) because if you run it using cmd.exe normally, there is no puppet.conf available (the only one on the machine was in C:\ProgramData\puppetlabs\puppet\etc\puppet.conf, which is used by the "Administrator" user only). This is what the root of my issue was. By cleaning the certs and then running puppet as admin, there were no more issues and all changes made to the puppet.conf file were read in immediately.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-12-22 10:47:46 -0500

Seen: 692 times

Last updated: Jan 07 '15