Issue #11563 has been updated by Rob Nolen.

Hi Josh,

Puppet seems to be executing this batch file just fine with command => 
'c:/test.bat'.  If I change it to command => 'cmd.exe /c c:\test.bat', I get 
the same results.

test.pp:
<pre>
exec {'test_bat':
                command => 'c:/test.bat',
                #OR command => 'cmd.exe /c c:/test.bat',
                path    => $::path,
}
</pre>

test.bat:
<pre>
start notepad.exe
</pre>


Notepad launches when I run puppet apply c:\test.pp.

However, this error pops up:
<pre>
c:\Program Files (x86)\Puppet Labs\Puppet\bin>puppet apply c:\test.pp
err: /Stage[main]//Exec[test_bat]/returns: change from notrun to 0 failed: 
Permission denied - 
C:/Users/rnolen/AppData/Local/Temp/puppet20120606-7872-53f9rb-0
notice: Finished catalog run in 1.14 seconds

icacls:
c:\Program Files (x86)\Puppet Labs\Puppet\bin>icacls c:\test.bat
c:\test.bat BUILTIN\Administrators:(I)(F)
            NT AUTHORITY\SYSTEM:(I)(F)
            BUILTIN\Users:(I)(RX)
            NT AUTHORITY\Authenticated Users:(I)(M)
            Mandatory Label\High Mandatory Level:(I)(NW)

Successfully processed 1 files; Failed processing 0 files
</pre>

Let me know if you need more info or clarification.

----------------------------------------
Bug #11563: Puppet on Windows can drop access control entries if the mode is 
not specified
https://projects.puppetlabs.com/issues/11563#change-64498

Author: Feifei Jia
Status: Accepted
Priority: Normal
Assignee: Josh Cooper
Category: windows
Target version: 2.7.x
Affected Puppet version: 2.7.12
Keywords: windows file mode permissions
Branch: 


I've tested Puppet client in Windows 2008 recently, on EC2 instance.

One problem I found is that, after I a first time successfully run, I 
encountered "CreateProcess() failed" error:

<pre>
info: Caching catalog for ip-xxxxxxxx.ec2.internal
info: Applying configuration version '1324881415'
err: /Stage[main]//Node[ip-xxxxxxxx.ec2.internal]/Foo::Set_role[chrome]/File 
[c:\download\setup_env.bat]: Could not evaluate: CreateProcess() failed: The 
system cannot find the file specified.
notice: /Stage[main]//Node[ip-xxxxxxxx.ec2.internal]/Foo::Set_role[chrome]/E 
xec[setup_env.bat]: Dependency File[c:\download\setup_env.bat] has failures: 
tru e warning: 
/Stage[main]//Node[ip-xxxxxxxx.ec2.internal]/Foo::Set_role[chrome]/ 
Exec[setup_env.bat]: Skipping because of failed dependencies
</pre>

Related manifests:

<pre>
class foo {
    define set_role ($role) {
        file { 'c:\download\setup_env.bat':
            ensure => file,
            provider => windows,
            content => template("foo/setup_env.bat.erb"),
        }

        exec { 'setup_env.bat':
            cwd => 'c:\download',
            path => 'c:\download;%PATH%',
            provider => windows,
            require => File['c:\download\setup_env.bat'],
        }
    }
}
</pre>

When I remove c:\download\setup_env.bat file, I can retrieve this file from 
Puppet master, and execute well.

Puppet 2.7.9

Facter 1.6.4

Windows 2008 Datacenter SP2

Any hints?


-- 
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