Ask Your Question
1

subscribe is not working as expected

asked 2014-02-11 09:40:15 -0600

shyp gravatar image

updated 2014-02-11 10:41:01 -0600

ramindk gravatar image

Need help to understand why its not working as expected :

I want to run the npm on directory /opt/cap/$app/tmp/ so before the npm install I am running a subscribe to create the dir ,but it still giving me an error that the directory "/opt/cap/$app/tmp/ "does not exists

exec { "cp_current":
  command     => "cp -d /opt/cap/${app}/current /opt/cap/${app}/tmp ",
  path        => "/usr/local/bin/:/usr/bin/:/bin/",
  refreshonly => true ,
  creates     => ["/opt/cap/${app}/tmp"],
}

exec { "npm_install":
  command     => "sudo /opt/cap/node/bin/npm install",
  cwd         => "/opt/cap/${app}/tmp/",
  path        => [ "/opt/cap/node/bin ...
(more)
edit retag flag offensive close merge delete

Comments

What do you get if you add notify { "cp -d /opt/cap/${app}/current /opt/cap/${app}/tmp ":} ?

Red Cricket gravatar imageRed Cricket ( 2014-02-11 11:27:51 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-02-11 11:54:48 -0600

ramindk gravatar image

Both Exec resources have refreshonly => true, which will keep either from executing unless something notifies the first Exec.

Most of the time you should use creates => or refreshonly =>, but not both.

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

Stats

Asked: 2014-02-11 09:40:15 -0600

Seen: 38 times

Last updated: Feb 11 '14