Puppet Class: sendmail::authinfo

Defined in:
manifests/authinfo.pp

Summary

Manage the Sendmail authinfo db file.

Overview

Examples:

class { 'sendmail::authinfo': }

class { 'sendmail::authinfo':
  source => 'puppet:///modules/sendmail/authinfo',
}

Parameters:

  • content (Optional[String]) (defaults to: undef)

    The desired contents of the authinfo file. This allows managing the authinfo file as a whole. Changes to the file automatically triggers a rebuild of the authinfo database file. This attribute is mutually exclusive with ‘source`.

  • source (Optional[String]) (defaults to: undef)

    A source file for the authinfo file. This allows managing the authinfo file as a whole. Changes to the file automatically triggers a rebuild of the authinfo database file. This attribute is mutually exclusive with ‘content`.

  • entries (Hash[String,Data]) (defaults to: {})

    A hash that will be used to create sendmail::authinfo::entry resources. This class can be used to create authinfo entries defined in hiera. The hiera hash should look like this:

    “‘yaml sendmail::authinfo::entries:

    'AuthInfo:example.com':
      value: '"U=auth" "P=secret"'
    'AuthInfo:192.168.67.89':
      value: '"U=fred" "P=wilma"'
    

    “‘



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'manifests/authinfo.pp', line 33

class sendmail::authinfo (
  Optional[String]  $content = undef,
  Optional[String]  $source  = undef,
  Hash[String,Data] $entries = {},
) {
  if ($content and $source) {
    fail('You cannot specify more than one of content, source, entries')
  }

  if ($content or $source) {
    if !empty($entries) {
      fail('You cannot specify more than one of content, source, entries')
    }

    class { 'sendmail::authinfo::file':
      content => $content,
      source  => $source,
    }
  }
  elsif !empty($entries) {
    $entries.each |$entry,$attributes| {
      sendmail::authinfo::entry { $entry:
        * => $attributes,
      }
    }
  }
}