FAQ
Hi Viktoriya,
On Oct 23, 2012, at 8:09 PM, VT wrote:

I am trying to execute a python script from manifest file on puppet windows based client:

exec {'ez_setup.py -U setuptools':

#command => 'C:\Python27\ez_setup.py -U setuptools',

cwd => 'C:\Python27',

path => 'C:\Python27;%PATH%',
That needs to be:

path => "C:\\Python27;${path}"

Since the catalog is compiled on the master, we need to use the value of the agent's path fact. Since we're interpolating, we have to use double quotes, which then means we have to escape backslashes.
#creates => 'C:\Program,

require => File['C:\Python27'],

}

I have 'file' block as well, which is copies the file first, before execution. However, I am getting following error:
******************************************************************************
C:\Program Files\Puppet Labs\Puppet Enterprise\bin>puppet agent --test --server
qalab2.pertino.com
info: Retrieving plugin
err: /File[C:/ProgramData/PuppetLabs/puppet/var/lib]: Could not evaluate: Could
not retrieve information from environment production source(s) puppet://qalab2.p
ertino.com/plugins
info: Caching catalog for homebasic32.pertino.com
info: Applying configuration version '1351047345'
err: /Stage[main]//Exec[ez_setup.py -U setuptools]/returns: change from notrun
to 0 failed: CreateProcess() failed:
notice: Finished catalog run in 4.06 seconds
I think that your command needs to be something like:

"python.exe ez_setup.py ..."

The issue is that the windows exec provider calls the Win32 API CreateProcess, which may not be able to execute the script directly.

Ideally we'd have a shell provider on Windows, but we haven't implemented one yet, e.g. to handle shell builtins like echo, mkdir, etc

Also for general debugging, I recommend running with --debug to show what commands each provider is executing.
**************************************************
I have no idea how to debug. Pls help!

Great Thanks,
Viktoriya

--
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/-/S3z9K-EZwoYJ.
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.
Josh

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
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

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedOct 24, '12 at 3:11a
activeOct 24, '12 at 6:04a
posts2
users2
websitepuppetlabs.com

2 users in discussion

VT: 1 post Josh Cooper: 1 post

People

Translate

site design / logo © 2022 Grokbase