Ask Your Question

how to run before deployment

asked 2015-08-31 10:17:08 -0600

DK gravatar image

Hi All,

I am beginner in puppet, we have project, project will generate xml file, config files, jars. Zip all these inside zip, we want to run, config files before deployment. Please suggest me how this can be achieved.

Regards, DK

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2015-09-01 07:54:59 -0600

czerwe gravatar image


if you want to execute the fix in before ALL other things you can consider to use a Stage that run's before the main stage. It is very well described here Language: Run Stages.

This require that your code is wrapped within a class because you only can assign a sage to a class.

If you just have to take case that a specific resource is running after or before an other resoruce the answer from StuartAbramsHumphries is perfect.


edit flag offensive delete link more

answered 2015-09-01 06:34:07 -0600

Hi DK,

have a look at relationships and ordering

within your puppet code you can specify if things need to occur before or after - it can get a bit complex with anchors and contain, however for simple usage just specify one resource needs another use the 'before' or 'require' relationship metaparameters.

edit flag offensive delete link more


Hi Stuart, Thank you very much, request you to provide any example mainefest code. Your help is much appreciated. Regards, DK

DK gravatar imageDK ( 2015-09-01 10:18:14 -0600 )edit

answered 2015-09-01 02:13:49 -0600

DevOPs_Paul.Tung gravatar image

updated 2015-09-03 05:54:45 -0600

Hi DK, I am beginner too. ;)

I am not sure this document would be help you:

"Language: Relationships and Ordering"

Maybe you could using chaining arrow '->' to meet your requirement.


exec { 'run_start':
  command => '/some/where/',
package { 'httpd':
  ensure => installed,

The '' will execute before install the 'httpd' package.

Hope to help you.

Edit on 20150903 to fix link description for more clear.

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



Asked: 2015-08-31 10:17:08 -0600

Seen: 165 times

Last updated: Sep 03 '15