Unverified Commit 502eb92b authored by Steve Traylen's avatar Steve Traylen Committed by GitHub
Browse files

Merge pull request #431 from traylenator/ten

Support RedHat, Rocky, Alma, CentOS 10
parents 862de441 40bf4ac2
Loading
Loading
Loading
Loading
+27 −3
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@
* [`postfix::transport`](#postfix--transport): Manage the transport map of postfix
* [`postfix::virtual`](#postfix--virtual): Manages the contents of the virtual map.

### Functions

* [`postfix::table_type_extension`](#postfix--table_type_extension): Returns the file extension for a table type

## Classes

### <a name="postfix"></a>`postfix`
@@ -719,12 +723,12 @@ Default value: `undef`

##### <a name="-postfix--canonical--lookup_table_suffix"></a>`lookup_table_suffix`

Data type: `String[1]`
Data type: `Optional[String[1]]`

Depends on the lookup table type, which is used on the postfix::hash and postfix::config resources.
Defaults to 'db', the suffix of the "hash" type.
Default is based on the suffix type correct for `postfix::lookup_table_type` parameter.

Default value: `'db'`
Default value: `undef`

### <a name="postfix--conffile"></a>`postfix::conffile`

@@ -1269,3 +1273,23 @@ Example: `/etc/postfix/my_virtual_map`.

Default value: `undef`

## Functions

### <a name="postfix--table_type_extension"></a>`postfix::table_type_extension`

Type: Puppet Language

Returns the file extension for a table type

#### `postfix::table_type_extension(String[1] $type = 'hash')`

The postfix::table_type_extension function.

Returns: `Enum['cdb','dir','lmdb','db']` The file extension of the table type

##### `type`

Data type: `String[1]`

The table type to report on
+18 −0
Original line number Diff line number Diff line
# @summary Returns the file extension for a table type
# @param type The table type to report on
# @return The file extension of the table type
#
function postfix::table_type_extension(String[1] $type = 'hash') >> Enum['cdb','dir','lmdb','db'] {
  $_generated_suffixes = {
    'cdb'  => 'cdb',
    'dbm'  => 'dir',
    'lmdb' => 'lmdb',
    'sdbm' => 'dir',
  }

  if $type in $_generated_suffixes {
    return $_generated_suffixes[$type]
  } else {
    return 'db'
  }
}
+8 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#
# @param lookup_table_suffix
#   Depends on the lookup table type, which is used on the postfix::hash and postfix::config resources.
#   Defaults to 'db', the suffix of the "hash" type.
#   Default is based on the suffix type correct for `postfix::lookup_table_type` parameter.
#
# @see https://www.postfix.org/canonical.5.html
#
@@ -40,10 +40,15 @@ define postfix::canonical (
  String                   $destination,
  Enum['present','absent'] $ensure              = 'present',
  Stdlib::Absolutepath     $file                = undef,
  String[1]                $lookup_table_suffix = 'db',
  Optional[String[1]]      $lookup_table_suffix = undef,
) {
  include postfix

  $_lookup_table_suffix = $lookup_table_suffix ? {
    Undef   => postfix::table_type_extension($postfix::lookup_table_type),
    default => $lookup_table_suffix,
  }

  $_file = pick($file, "${postfix::confdir}/canonical")

  case $ensure {
@@ -68,6 +73,6 @@ define postfix::canonical (
    lens    => 'postfix_canonical.lns',
    changes => $changes,
    require => Package['postfix'],
    notify  => Exec["generate ${_file}.${lookup_table_suffix}"],
    notify  => Exec["generate ${_file}.${_lookup_table_suffix}"],
  }
}
+1 −7
Original line number Diff line number Diff line
@@ -55,13 +55,7 @@ define postfix::map (
    fail 'You must provide either \'source\' or \'content\', not both'
  }

  $_generated_suffix = $type ? {
    'cdb'   => 'cdb',
    'dbm'   => 'dir',
    'lmdb'  => 'lmdb',
    'sdbm'  => 'dir',
    default => 'db',
  }
  $_generated_suffix = postfix::table_type_extension($type)

  # CIDR and PCRE maps need a postfix reload, but not a postmap
  if $type =~ /^(cidr|pcre|regexp)$/ {
+10 −5
Original line number Diff line number Diff line
@@ -41,34 +41,39 @@
      "operatingsystem": "RedHat",
      "operatingsystemrelease": [
        "8",
        "9"
        "9",
        "10"
      ]
    },
    {
      "operatingsystem": "CentOS",
      "operatingsystemrelease": [
        "9"
        "9",
        "10"
      ]
    },
    {
      "operatingsystem": "AlmaLinux",
      "operatingsystemrelease": [
        "8",
        "9"
        "9",
        "10"
      ]
    },
    {
      "operatingsystem": "OracleLinux",
      "operatingsystemrelease": [
        "8",
        "9"
        "9",
        "10"
      ]
    },
    {
      "operatingsystem": "Rocky",
      "operatingsystemrelease": [
        "8",
        "9"
        "9",
        "10"
      ]
    },
    {
Loading