Ask Your Question
0

how to run start.sh before deployment

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

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 start.sh, 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
0

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

czerwe gravatar image

Hi,

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.

br

edit flag offensive delete link more
0

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

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

Comments

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 -0500 )edit
0

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

DevOPs_Paul.Tung gravatar image

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

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.

eg:

exec { 'run_start':
  command => '/some/where/start.sh',
}
->
package { 'httpd':
  ensure => installed,
}

The 'start.sh' 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

2 followers

Stats

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

Seen: 150 times

Last updated: Sep 03 '15