diff --git a/lib/puppet/provider/a2mod/a2mod.rb b/lib/puppet/provider/a2mod/a2mod.rb index a2fdd7c..56e293e 100644 --- a/lib/puppet/provider/a2mod/a2mod.rb +++ b/lib/puppet/provider/a2mod/a2mod.rb @@ -1,21 +1,21 @@ Puppet::Type.type(:a2mod).provide(:a2mod) do desc "Manage Apache 2 modules on Debian and Ubuntu" - - commands :encmd => "a2enmod" - commands :discmd => "a2dismod" - + + optional_commands :encmd => "a2enmod" + optional_commands :discmd => "a2dismod" + defaultfor :operatingsystem => [:debian, :ubuntu] def create encmd resource[:name] end - + def destroy discmd resource[:name] end - + def exists? - mod= "/etc/apache2/mods-enabled/" + resource[:name] + ".load" + mod= "/etc/apache2/mods-enabled/" + resource[:name] + ".load" File.exists?(mod) end end