OK, I got registry::value working by commenting out the calls to
validate_re. I will file a ticket for that. Unfortunately, though, the
Windows gotchas continue. If you manually edit PATH in the System control
panel, the new value shows up the next time you open a new cmd window. If,
however, you edit it in the registry, the change doesn't show up until you
reboot the machine. I've verified this behavior in XP and Server 2003.

I also discovered an "inconvenience" with the puppet registry module.
registry::value calls registry_value, which appends the value to the key to
create a namevar. That means you can't edit PATH within a module that has a
dependency on another module that edits path; if you do, you get a
duplicate declaration error.
On Friday, August 17, 2012 6:09:50 PM UTC-5, Josh Cooper wrote:
On Fri, Aug 17, 2012 at 2:38 PM, Jeff Sussna wrote:
Hmm..it appears that $::path is returning multiple copies of the Puppet
paths, along with "/user/bin" (which as you can imagine causes problems for
Windows), in addition to the explicitly defined PATH string. Any idea why?
So I get:

C:\work\puppet> envpuppet puppet apply -e "notice($::path)"
notice: Scope(Class[main]):

The `:path` setting is populated from the environment, but we also add
in /usr/sbin and /sbin (in defaults.rb), obviously not helpful. Filed
as https://projects.puppetlabs.com/issues/16019. With that said it
shouldn't prevent the exec from working.

You can do something like the following to see how puppet resolves
which cmd.exe to run:

C:\work\puppet>envpuppet irb
irb(main):001:0> require 'puppet'
=> true
irb(main):002:0> Puppet::Util.which('cmd.exe')
=> "C:/Windows/system32/cmd.exe"

Or is it not finding reg.exe?


Josh Cooper
Developer, Puppet Labs
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GzJJIqrhPXgJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 13 of 17 | next ›
Discussion Overview
grouppuppet-users @
postedAug 16, '12 at 7:44p
activeAug 21, '12 at 6:00p



site design / logo © 2022 Grokbase