diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-14 20:26:31 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-14 20:26:31 +0000 |
commit | 53c2f0a4c93d51eed664761bc652e73ccf078a82 (patch) | |
tree | a6d54f42f4f51eb9f94efb7d3452e7cf284ce39f /lib/puppet | |
parent | 4c1a70c79fda6ff44b016217cb228686f99abf63 (diff) | |
download | puppet-53c2f0a4c93d51eed664761bc652e73ccf078a82.tar.gz puppet-53c2f0a4c93d51eed664761bc652e73ccf078a82.tar.xz puppet-53c2f0a4c93d51eed664761bc652e73ccf078a82.zip |
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
Diffstat (limited to 'lib/puppet')
-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?] |