Issue #16997 has been updated by Josh Cooper.

Subject changed from Puppet gem provider on windows does not work as expected 
to Allow path environment to be specified on a per-resource basis
Description updated
Status changed from Duplicate to Accepted

Hi Luis, we discussed this and came to the conclusion that this would be 
possible today if you could modify the PATH that the provider uses to execute 
its command(s), so ideally you could do:

<pre>
package { 'ruby193':
  ensure => installed,
  source => 'V:\shardata\Puppet\rubyinstaller-1.9.3-p194.exe',
  install_options => [ '/verysilent', { '/dir' => 'C:\ruby', '/tasks' => 
'assocfiles,modpath' } ],
  provider => :windows
}

package { 'nokogiri':
    ensure => '1.5.5',
    provider => 'gem',
    path => "c:\\ruby;$::path",
    require => Package['ruby193']
} 
</pre>

We've seen this issue come up on the mailing list for other package types, and 
the only workaround has been to modify the provider source. This seems like a 
generally useful thing for any provider that needs to execute commands.

Starting in Puppet 3, you can manage executable packages using the `package` 
resource. However, you'll have to install the gem using an exec and provide a 
custom `path` parameter.
----------------------------------------
Bug #16997: Allow path environment to be specified on a per-resource basis
https://projects.puppetlabs.com/issues/16997#change-73794

Author: Luis Mayorga
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Currently, only the exec resource type permits the path to be specified for 
commands it executes. However, it would be generally useful for other resource 
types. For example, to specify the path to use when executing package commands 
(that are relative).

The only workaround is to modify the provider source or to use the 
<http://docs.puppetlabs.com/references/latest/configuration.html#path> setting, 
though that is global, and won't work in cases where a module installs a 
package in a location that isn't already in the path, e.g. Java applications on 
windows.

Original description:

Hi,

I just installed ruby1.9.3.exe package on a windows build server and also i was 
thinking on installing some gems. It seems that is installing the gems as part 
as as the 1.8.7 ruby version shipped with the Puppet Client windows installer. 

<pre>
class ruby{

file {'ruby':
        name => 'C:\Temp\rubyinstaller-1.9.3-p194.exe',
        ensure => present,
        source => 'V:\shardata\Puppet\rubyinstaller-1.9.3-p194.exe'
}


exec { 'ruby':
                command => 'C:\Temp\rubyinstaller-1.9.3-p194.exe /verysilent 
/dir="C:\ruby" /tasks="assocfiles,modpath"',
                require => File["ruby"]
        }
        
        
# package { 'nokogiri':
        # ensure => '1.5.5',
        # provider => 'gem',
        # require => Exec['ruby']
# } 
</pre>

Should I still use the gem provider or should i use the exec and map the new 
ruby package gem.bat path?




-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to