Ask Your Question
1

only restart a subservice (OpenVPN)

asked 2014-02-28 07:56:53 -0600

mikek gravatar image

For OpenVPN, there are specific tunnels which can be managed through the service commands. How can you subscribe to a service which is part of a service?

e.g., I tried to create something like this:

service { "ovpn-${name}":
    name => 'openvpn',
    ensure => running,
    start => "service openvpn start ${name}",
    restart => "service openvpn restart ${name}",
    status => "service openvpn status ${name}",
    stop => "service openvpn stop ${name}",
}

It doesn't work because it says the service (openvpn) is already declared. If I remove the name => component of the above, it says it couldn't find an init script or upstart file for it.

This ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2014-02-28 08:31:24 -0600

updated 2014-02-28 08:31:56 -0600

Would something like

exec { "restart-ovpn-${name}":
  command     => "service openvpn restart ${name}",
  refreshonly => true,
}


...
notify => Exec["restart-ovpn-xyz"],

work for you?

edit flag offensive delete link more
1

answered 2014-03-03 02:57:55 -0600

You can create a symlink for each openvpn connection to openvpn. Besides this: have you tried another provider?

edit flag offensive delete link more

Comments

The symlink strategy would work, but it's pretty specific to the OS or distribution. What do you mean by another provider?

mikek gravatar imagemikek ( 2014-03-03 03:40:53 -0600 )edit

Every resource type can have multiple providers. For service resource the following providers exist: http://docs.puppetlabs.com/references/latest/type.html#service-providers Normally puppet tries to find the proper ...(more)

Martin Alfke gravatar imageMartin Alfke ( 2014-03-03 04:17:08 -0600 )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: 2014-02-28 07:56:53 -0600

Seen: 319 times

Last updated: Mar 03 '14