Can Puppet Windows version support system variables like "%HOMEDRIVE%"?

383 views
Skip to first unread message

Feifei Jia

unread,
Mar 14, 2012, 2:48:20 AM3/14/12
to puppet...@googlegroups.com
I've created a testing manifest like this:

file { '%HOMEDIRVE%\testdir':
    ensure => directory,
    provider => windows,
}

Applied with error:

C:\Users\Administrator>puppet apply c:\init.pp
warning: Could not retrieve fact fqdn
Could not parse for environment production: Could not match %HOMEDRIVE% at c:/in
it.pp:1 on node win-kw0tm8m9vbs

I'd like to know if Puppet Windows support Windows environment variables? Thanks.

Puppet version: 2.7.12
OS version: Windows 2008 R2

Bruce Richardson

unread,
Mar 14, 2012, 4:54:04 AM3/14/12
to puppet...@googlegroups.com
On Tue, Mar 13, 2012 at 11:48:20PM -0700, Feifei Jia wrote:
>
> I'd like to know if Puppet Windows support Windows environment variables?

Operating system environment variables are not directly accessible, no,
although any that beging FACTER_ will be imported as facts (so that
"%FACTER_EXAMPLE%" is available as "$example". You can create your own
custom facts to import any others that you want. See here:

http://projects.puppetlabs.com/projects/puppet/wiki/Environment_Variables_Patterns

--
Bruce

The ice-caps are melting, tra-la-la-la. All the world is drowning,
tra-la-la-la-la. -- Tiny Tim.

Reply all
Reply to author
Forward
0 new messages