diff options
| -rwxr-xr-x | lib/puppet/type/exec.rb | 7 | ||||
| -rwxr-xr-x | lib/puppet/type/mount.rb | 3 | ||||
| -rw-r--r-- | lib/puppet/type/service.rb | 3 |
3 files changed, 12 insertions, 1 deletions
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?] |
