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.