Sha256: 36af74c3167945dbaac698980e85b2509533c2860fbb819a4fd8883782167193

Contents?: true

Size: 825 Bytes

Versions: 11

Compression:

Stored size: 825 Bytes

Contents

require 'puppet/provider/a2mod'

Puppet::Type.type(:a2mod).provide(:a2mod, :parent => Puppet::Provider::A2mod) do
    desc "Manage Apache 2 modules on Debian and Ubuntu"

    optional_commands :encmd => "a2enmod"
    optional_commands :discmd => "a2dismod"
    commands :apache2ctl => "apache2ctl"

    confine :osfamily => :debian
    defaultfor :operatingsystem => [:debian, :ubuntu]

    def self.instances
      modules = apache2ctl("-M").lines.collect { |line|
        m = line.match(/(\w+)_module \(shared\)$/)
        m[1] if m
      }.compact

      modules.map do |mod|
        new(
          :name     => mod,
          :ensure   => :present,
          :provider => :a2mod
        )
      end
    end

    def create
        encmd resource[:name]
    end

    def destroy
        discmd resource[:name]
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.6.0 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.5.2 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.5.1 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.5.0 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.4.1 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.4.0 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.3.3 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.3.2 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.3.1 modules/apache/lib/puppet/provider/a2mod/a2mod.rb
freighthop-0.3.0 modules/apache/lib/puppet/provider/a2mod/a2mod.rb