Ask Your Question

Path Attribute File to Exec Command - Windows Agent bat file

asked 2014-01-30 14:33:40 -0600

javatestcase gravatar image

updated 2014-01-30 14:54:49 -0600

I am trying to create a .bat file to run on my Windows Agents. The batch file is generated in a File type by a template, and then executed by the Exec type. Here is the code:

define nexus::version () {  
    file { "create-bat":
      path => "$WHAT_GOES_HERE/modules/nexus/files/nexus_java_exec.bat",
      content => template("/home/puppet/modules/nexus/templates/nexus_java.conf.erb");
    exec { "execute_bat":
      command  => "$WHAT_GOES_HERE/modules/nexus/files/nexus_java_exec.bat",
      path      => 'C:/Program Files/Java/jdk1.6.0_20/bin',

Running locally in Windows, I can simply use the local path, and everything works:

$WHAT_GOES_HERE = 'C:/ProgramData/PuppetLabs/etc/puppet'

However, since i ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-01-30 16:31:44 -0600

javatestcase gravatar image

updated 2014-01-30 19:51:01 -0600

OK, I just wasted some time here... The answer is of course option 1.

$WHAT_GOES_HERE = 'C:/ProgramData/PuppetLabs/etc/puppet'

I didn't have the path properly setup, so the puppettmp_6166 extension was Puppet telling me the parent directory didn't exist. The poor error messaging is already logged:

Known issue with Pupper Issue 1763

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-01-30 14:33:40 -0600

Seen: 2,632 times

Last updated: Jan 30 '14