Sha256: 0cf7cdecd5e7d6af01be7c2f1ac73523c3ae924b1ebf0f73fae5253e3b38f718

Contents?: true

Size: 1.5 KB

Versions: 23

Compression:

Stored size: 1.5 KB

Contents

module Puppet
  newtype(:maillist) do
    @doc = "Manage email lists.  This resource type currently can only create
      and remove lists, it cannot reconfigure them."

    ensurable do
      defaultvalues

      newvalue(:purged) do
        provider.purge
      end

      def change_to_s(current_value, newvalue)
        return "Purged #{resource}" if newvalue == :purged
        super
      end

      def insync?(is)
        return true if is == :absent && should == :purged
        super
      end
    end

    newparam(:name, :namevar => true) do
      desc "The name of the email list."
    end

    newparam(:description) do
      desc "The description of the mailing list."
    end

    newparam(:password) do
      desc "The admin password."
    end

    newparam(:webserver) do
      desc "The name of the host providing web archives and the administrative interface."
    end

    newparam(:mailserver) do
      desc "The name of the host handling email for the list."
    end

    newparam(:admin) do
      desc "The email address of the administrator."
    end

    def generate
      if provider.respond_to?(:aliases)
        should = self.should(:ensure) || :present
        if should == :purged
          should = :absent
        end
        atype = Puppet::Type.type(:mailalias)

        provider.aliases.
          reject  { |name,recipient| catalog.resource(:mailalias, name) }.
          collect { |name,recipient| atype.new(:name => name, :recipient => recipient, :ensure => should) }
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
puppet-2.6.18 lib/puppet/type/maillist.rb
puppet-2.6.17 lib/puppet/type/maillist.rb
puppet-2.6.16 lib/puppet/type/maillist.rb
puppet-2.6.15 lib/puppet/type/maillist.rb
puppet-2.6.14 lib/puppet/type/maillist.rb
puppet-2.6.13 lib/puppet/type/maillist.rb
puppet-2.7.6 lib/puppet/type/maillist.rb
puppet-2.6.12 lib/puppet/type/maillist.rb
puppet-2.7.5 lib/puppet/type/maillist.rb
puppet-2.6.11 lib/puppet/type/maillist.rb
puppet-2.7.4 lib/puppet/type/maillist.rb
puppet-2.6.10 lib/puppet/type/maillist.rb
puppet-2.7.3 lib/puppet/type/maillist.rb
puppet-2.7.1 lib/puppet/type/maillist.rb
puppet-2.6.9 lib/puppet/type/maillist.rb
puppet-2.6.8 lib/puppet/type/maillist.rb
puppet-2.6.7 lib/puppet/type/maillist.rb
puppet-2.6.6 lib/puppet/type/maillist.rb
puppet-2.6.5 lib/puppet/type/maillist.rb
puppet-2.6.4 lib/puppet/type/maillist.rb