Ask Your Question
0

puppet mount with service

asked 2013-11-21 01:58:32 -0500

rakkaus gravatar image

Hi guys! can you help me with relationships in puppet?

I have some service that depend on mounted dir so I need launch service ONLY_IF the dir will be mounted successfully.

I belive that puppet can manage this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-11-25 07:37:08 -0500

rjc gravatar image

updated 2013-11-25 14:13:06 -0500

Stefan gravatar image

If you're managing your mount using puppet, then it should be as simple as:

mount { '/mount/point':
  ensure => mounted,
  ...
}

service { 'service':
  ...
  require => Mount['/mount/point']
}

Regards,

rjc

edit flag offensive delete link more

Comments

Thank you! but what if mount will not success? I need to be 100% sure that my `service` that depend on mount will be skipped when `mount` will be failed ...(more)

rakkaus gravatar imagerakkaus ( 2013-11-25 08:12:18 -0500 )edit

That's why I have used 'ensure => mounted' in my example - it'll take care of that. Your service will fail with: Dependency Mount[/moun/point] has failures: true (/Stage ...(more)

rjc gravatar imagerjc ( 2013-11-25 08:53:01 -0500 )edit

aha! I got it! thank you!

rakkaus gravatar imagerakkaus ( 2013-11-25 09:09:41 -0500 )edit

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: 2013-11-21 01:58:32 -0500

Seen: 87 times

Last updated: Nov 25 '13