Sha256: 0f986e2e538a26b9d7b19b57f6b8005b68c3e178cf98e414a1f6f6b630ebf53b

Contents?: true

Size: 1.25 KB

Versions: 153

Compression:

Stored size: 1.25 KB

Contents

module Puppet
  Type.newtype(:mailalias) do
    @doc = "Creates an email alias in the local alias database."

    ensurable

    newparam(:name, :namevar => true) do
      desc "The alias name."
    end

    newproperty(:recipient, :array_matching => :all) do
      desc "Where email should be sent.  Multiple values
        should be specified as an array.  The file and the
        recipient entries are mutually exclusive."
    end

    newproperty(:file) do
      desc "A file containing the alias's contents.  The file and the
        recipient entries are mutually exclusive."

      validate do |value|
	unless Puppet::Util.absolute_path?(value)
	  fail Puppet::Error, _("File paths must be fully qualified, not '%{value}'") % { value: value }
	end
      end
    end

    newproperty(:target) do
      desc "The file in which to store the aliases.  Only used by
        those providers that write to disk."

      defaultto { if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile)
          @resource.class.defaultprovider.default_target
        else
          nil
        end
      }
    end

    validate do
      if self[:recipient] && self[:file]
	self.fail _("You cannot specify both a recipient and a file")
      end
    end
  end
end

Version data entries

153 entries across 153 versions & 2 rubygems

Version Path
puppet-5.5.22 lib/puppet/type/mailalias.rb
puppet-5.5.22-x86-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.22-x64-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.22-universal-darwin lib/puppet/type/mailalias.rb
puppet-5.5.21 lib/puppet/type/mailalias.rb
puppet-5.5.21-x86-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.21-x64-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.21-universal-darwin lib/puppet/type/mailalias.rb
puppet-5.5.20 lib/puppet/type/mailalias.rb
puppet-5.5.20-x86-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.20-x64-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.20-universal-darwin lib/puppet/type/mailalias.rb
puppet-5.5.19 lib/puppet/type/mailalias.rb
puppet-5.5.19-x86-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.19-x64-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.19-universal-darwin lib/puppet/type/mailalias.rb
puppet-5.5.18 lib/puppet/type/mailalias.rb
puppet-5.5.18-x86-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.18-x64-mingw32 lib/puppet/type/mailalias.rb
puppet-5.5.18-universal-darwin lib/puppet/type/mailalias.rb