The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Feature #7332

resource pre / post condition on e.g. service status

Added by Frederik Wagner almost 3 years ago. Updated almost 3 years ago.

Status:DuplicateStart date:05/03/2011
Priority:NormalDue date:
Assignee:Nigel Kersten% Done:

0%

Category:language
Target version:-
Affected Puppet version: Branch:
Keywords:service, exec, conditions

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

In certain circumstances it is need that a service is down during the application of a resource. So it would be extremely usefull to have e.g. a service stopped, have a resource applied and have a service started again.

For example, to run a udevadm trigger to rename network interfaces, the service network should be down. So it would read on the shell:

 $ service network stop
 $ udevadm trigger
 $ service network start

This can be straigt forwardly but very dirty implemented with exec resources with dependencies, but it could interefere badly with an explicit service resource (in this case checking for network running).

So some kine of resource pre/post condition on for the service would be very usefull.


Related issues

Duplicates Puppet - Feature #7594: It should be possible to trigger specific actions with no... Accepted 05/19/2011

History

#1 Updated by James Turnbull almost 3 years ago

  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Nigel Kersten

#2 Updated by Nigel Kersten almost 3 years ago

  • Status changed from Needs Decision to Duplicate

Frederik, I believe this is a dupe of #7594 so that we can have more specific event notifications.

#3 Updated by Frederik Wagner almost 3 years ago

Sounds more or less right, this being a dupe of #7594. But I’m not sure if that one is covering also pre/post condition to a resource, like my example: Having a service stopped during a resource execution. I would add that (if that’s not overloading the DSL).

#4 Updated by Nigel Kersten almost 3 years ago

Frederik Wagner wrote:

Sounds more or less right, this being a dupe of #7594. But I’m not sure if that one is covering also pre/post condition to a resource, like my example: Having a service stopped during a resource execution. I would add that (if that’s not overloading the DSL).

The idea would be that you could do something like this:

exec { "pre":
  notify => Service["foo"].stop,
}

exec { "post":
  notify => Service["foo"].start,
}

service { "foo":
  ensure => running, 
  enable => true,
}

Obviously this won’t work right now due to the automatic relationships we set up with notify, but that would have to change.

#5 Updated by Frederik Wagner almost 3 years ago

Ah, thanks for the ‘idea’ of it. Yes, that sounds like the right direction.

Also available in: Atom PDF