From 53c2f0a4c93d51eed664761bc652e73ccf078a82 Mon Sep 17 00:00:00 2001 From: luke Date: Sat, 14 Jul 2007 20:26:31 +0000 Subject: Fixing #691 -- I added "refreshable" features to the types that can restart, although exec does not have providers (yet), so I just made the docs a bit clearer git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2696 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/type/exec.rb | 7 ++++++- lib/puppet/type/mount.rb | 3 +++ lib/puppet/type/service.rb | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb index c3ea0b755..5e281978a 100755 --- a/lib/puppet/type/exec.rb +++ b/lib/puppet/type/exec.rb @@ -6,7 +6,12 @@ module Puppet @doc = "Executes external commands. It is critical that all commands executed using this mechanism can be run multiple times without harm, i.e., they are *idempotent*. One useful way to create idempotent - commands is to use the *creates* parameter. + commands is to use the checks like ``creates`` to avoid running the + command unless some condition is met. + + Note also that you can restrict an ``exec`` to only run when it receives + events by using the ``refreshonly`` parameter; this is a useful way to + have your configuration respond to events with arbitrary commands. It is worth noting that ``exec`` is special, in that it is not currently considered an error to have multiple ``exec`` instances diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb index 737cc41c2..784d1bbf8 100755 --- a/lib/puppet/type/mount.rb +++ b/lib/puppet/type/mount.rb @@ -8,6 +8,9 @@ module Puppet Note that if a ``mount`` receives an event from another resource, it will try to remount the filesystems if ``ensure => mounted`` is set." + + feature :refreshable, "The provider can remount the filesystem.", + :methods => [:remount] # Use the normal parent class, because we actually want to # call code when sync() is called. diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb index 89b64cc97..8da65b28d 100644 --- a/lib/puppet/type/service.rb +++ b/lib/puppet/type/service.rb @@ -22,6 +22,9 @@ module Puppet service depends on the platform. You can provide a special command for restarting with the ``restart`` attribute." + feature :refreshable, "The provider can restart the service.", + :methods => [:restart] + feature :enableable, "The provider can enable and disable the service", :methods => [:disable, :enable, :enabled?] -- cgit