Merge pull request #23 from ccaum/13860_autorequire_httpd_package
(#13860) Autorequire Package['httpd']
This commit is contained in:
commit
789d8d3f3b
@ -1,21 +1,21 @@
|
|||||||
Puppet::Type.type(:a2mod).provide(:a2mod) do
|
Puppet::Type.type(:a2mod).provide(:a2mod) do
|
||||||
desc "Manage Apache 2 modules on Debian and Ubuntu"
|
desc "Manage Apache 2 modules on Debian and Ubuntu"
|
||||||
|
|
||||||
commands :encmd => "a2enmod"
|
optional_commands :encmd => "a2enmod"
|
||||||
commands :discmd => "a2dismod"
|
optional_commands :discmd => "a2dismod"
|
||||||
|
|
||||||
defaultfor :operatingsystem => [:debian, :ubuntu]
|
defaultfor :operatingsystem => [:debian, :ubuntu]
|
||||||
|
|
||||||
def create
|
def create
|
||||||
encmd resource[:name]
|
encmd resource[:name]
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
discmd resource[:name]
|
discmd resource[:name]
|
||||||
end
|
end
|
||||||
|
|
||||||
def exists?
|
def exists?
|
||||||
mod= "/etc/apache2/mods-enabled/" + resource[:name] + ".load"
|
mod= "/etc/apache2/mods-enabled/" + resource[:name] + ".load"
|
||||||
File.exists?(mod)
|
File.exists?(mod)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Puppet::Type.newtype(:a2mod) do
|
Puppet::Type.newtype(:a2mod) do
|
||||||
@doc = "Manage Apache 2 modules on Debian and Ubuntu"
|
@doc = "Manage Apache 2 modules on Debian and Ubuntu"
|
||||||
|
|
||||||
ensurable
|
ensurable
|
||||||
|
|
||||||
newparam(:name) do
|
newparam(:name) do
|
||||||
@ -8,5 +8,9 @@ Puppet::Type.newtype(:a2mod) do
|
|||||||
|
|
||||||
isnamevar
|
isnamevar
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
autorequire(:package) { catalog.resource(:package, 'httpd')}
|
||||||
|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user