![Spencer Krum](/assets/img/avatar_default.png)
This renames the classes and defined types from apache to httpd. With the 'httpd' module available, we can migrate usage of 'apache' to 'httpd.' Eventually this will free the 'apache' namespace. A native ruby type and provider is contained in this class. It is not namespaced to the class name so it has been renamed from a2mod to httpd_mod. Change-Id: I056eb28a13e7ccc95f1496019bedc332c17dd458
22 lines
486 B
Ruby
22 lines
486 B
Ruby
Puppet::Type.type(:httpd_mod).provide(:httpd_mod) do
|
|
desc "Manage Apache 2 modules on Debian and Ubuntu"
|
|
|
|
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"
|
|
File.exists?(mod)
|
|
end
|
|
end
|