Create and run .bat

29 views
Skip to first unread message

Martin Hátaš

unread,
Aug 4, 2014, 12:13:15 PM8/4/14
to puppet...@googlegroups.com
Hi, I´m new in puppet and iam trying just copy .bat file from pupet server (which works fine) and then run it.
My code is:

        file { "c:\\install\\interactive\\install-silent.bat":
                source_permissions => ignore,
                content => template('interactive_9_4_7/install-silent.erb'),
        }

        exec { 'c:/install/interactive/install-silent.bat':
                require => [Exec["unzip_interactive_installer"], File[c:/install/interactive/install$
                logoutput => true,
        }

And I allways get this error:

Error: c:/install/interactive/install-silent.bat returned 1 instead of one of [0]
Error: /Stage[main]/Interactive_9_4_7/Exec[c:/install/interactive/install-silent.bat]/returns: change from notrun to 0 failed: c:/install/interactive/install-silent.bat returned 1 instead of one of [0]

If I run copied file manualy, it works fine.
Thanks for advice
Martin

Neil

unread,
Aug 4, 2014, 1:07:51 PM8/4/14
to PuppetList

Hi

You have interchanged / and \\

Btw I'd put any name you repeat in a variable to avoid this sort of thing.

Also this looks like something you might like to do a lot so turn it into a  define you can reuse.

Cheers

Neil

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/74925386-dbf8-4038-99eb-0535d06b5661%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages