1

When I tried to install my puppet agent on one my servers (windows 2008 R2), the confdir seems to default to u:\ drive. U: drive is not present for user.

I can also see that the puppet labs directory is present at C:\ProgramData\PuppetLabs\puppet\etc

I when I try to run puppet via:

puppet agent --test 

I still get the following error.

Validation of File[U:/.puppet/var/log] failed: Failed to get volume information:
  The system cannot find the path specified.

I have successfully installed this on my other Windows 2008 R2 servers. Any ideas?

2
  • Also tried running puppet agent --confdir=C:\ProgramData\PuppetLabs\puppet\etc --test
    – Ankh2054
    Mar 31, 2015 at 13:57
  • Needed to run command prompt as an administrator.
    – Ankh2054
    Mar 31, 2015 at 15:02

1 Answer 1

2

You are running puppet as a non-administrator (or as an administrator in a non-elevated shell) and $env:HOME (or %HOME% in cmd.exe) is evaluating to U:\ - You should fix that to whereever your HOME directory really is (typically C:\Users\username.

PS C:\> $env:Home
C:\Users\rob

How it is set by Puppet

If you are running as a member of the Administrators group (in an elevated shell), it will expand to C:\ProgramData\PuppetLabs, but when you are running in a non-elevated instance, it evaluates to ~/.puppet. Ruby converts "~" on Windows by looking at HOME, HOMEDRIVE, and USERPROFILE. If it finds one of those it uses them. So if you don't find HOME set, look at the other two variables.

This is where Puppet sets it:

https://github.com/puppetlabs/puppet/blob/53d71b040ea4ceb507daf80275ed75ee141bfdd4/lib/puppet/util/run_mode.rb#L79-L81

https://github.com/puppetlabs/puppet/blob/53d71b040ea4ceb507daf80275ed75ee141bfdd4/lib/puppet/util/run_mode.rb#L51-L53

Why I'd recommend against running the agent as a non-admin

I wouldn't recommend running the Agent tests as a non-Administrator since the installed service is running as an administrator - it will try to request another certificate from the master and fail because it already has one (and only one is allowed).

Unless you have the service disabled or you did some extra work after the installation to set it so, the account it is running under is a member of the local Administrators group (or becomes one during install).

You can run masterless puppet apply as a non-administrator without issue.

Changing Environment Variables

To change your environment variables, go to your System Properties in Control panel to Advanced -> Environment Variables... and look in both your user and system variables for HOME (see the image). Then just double click on the one you want to change and edit it.

Setting Environment Variables

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .