Skip to content
Snippets Groups Projects
Select Git revision
  • cb5d0bbf20aec6edd52aab95b6c1051258313d98
  • master default protected
  • release-1.3.10
  • popover-bootstrap-3.4
  • zf-3.x
  • 3.0.9
  • 3.0.8
  • 1.3.10
  • 3.0.7
  • 3.0.6
  • 3.0.5
  • 3.0.4
  • 3.0.3
  • 3.0.2
  • 3.0.1
  • 3.0.0
  • 1.3.9
  • 1.3.8
  • 1.3.7
  • 1.3.6
  • 1.3.5
  • 1.3.4
  • 1.3.3
  • 1.3.2
  • 1.3.1
25 results

AuthController.php

Blame
  • Forked from lib / unicaen / auth
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    canonical.pp 1.65 KiB
    #== Definition: postfix::canonical
    #
    #Manages content of the /etc/postfix/canonical map.
    #
    #Parameters:
    #- *name*: name of address postfix will lookup. See canonical(5).
    #- *destination*: where the emails will be delivered to. See canonical(5).
    #- *ensure*: present/absent, defaults to present.
    #
    #Requires:
    #- Class["postfix"]
    #- Postfix::Hash["/etc/postfix/canonical"]
    #- Postfix::Config["canonical_maps"] or Postfix::Config["sender_canonical_maps"] or Postfix::Config["recipient_canonical_maps"]
    #- augeas
    #
    #Example usage:
    #
    #  node "toto.example.com" {
    #
    #    include postfix
    #
    #    postfix::hash { "/etc/postfix/recipient_canonical":
    #      ensure => present,
    #    }
    #    postfix::config { "canonical_alias_maps":
    #      value => "hash:/etc/postfix/recipient_canonical"
    #    }
    #    postfix::canonical {
    #      "user@example.com":
    #        file        => "/etc/postfix/recipient_canonical",
    #        ensure      => present,
    #        destination => "root";
    #    }
    #  }
    #
    define postfix::canonical (
      $destination,
      $nexthop='',
      $file='/etc/postfix/canonical',
      $ensure='present'
    ) {
      include postfix::augeas
    
      case $ensure {
        'present': {
          $changes = [
            "set pattern[. = '${name}'] '${name}'",
            "set pattern[. = '${name}']/destination '${destination}'",
          ]
        }
    
        'absent': {
          $changes = "rm pattern[. = '${name}']"
        }
    
        default: {
          fail("Wrong ensure value: ${ensure}")
        }
      }
    
      augeas {"Postfix canonical - ${name}":
        incl    => $file,
        lens    => 'Postfix_Canonical.lns',
        changes => $changes,
        require => [Package['postfix'], Augeas::Lens['postfix_canonical']],
        notify  => Exec["generate ${file}.db"],
      }
    }