O'Reilly logo

Learning Puppet for Windows Server by Fuat Ulugay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running commands

The exec resource type is used to execute commands. The command in the exec resource must be able to run multiple times without any problems or harm. If it causes problems, it must be limited with conditions and run only when these conditions are met.

exec can directly execute .com, .bat, .exe, and so on. Also, it can log the output and the exit status. If you want to run the shell built-in commands in this case, Puppet does not support these commands directly. Assuming that you want to use the echo command, you need to use it with cmd and the command should look as follows: cmd.exe /c echo helloworld. Now let's check the most basic definition:

exec { 'execname':
command => 'command to execute',
}

As you can see, the simplest exec ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required