Skip to content
Snippets Groups Projects
Select Git revision
  • cee96c5a9ffa9d6aeadca237ea3b0798bca37525
  • master default protected
  • ll-workflow
  • alc-scindage-donnees-pj
  • b24
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • b22
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
  • 24.0-beta12
  • 24.0-beta11
41 results

build-synchronisation.php

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    config.pp 1.31 KiB
    /*
    == Definition: postfix::config
    
    Uses the "postconf" command to add/alter/remove options in postfix main
    configuation file (/etc/postfix/main.cf).
    
    Parameters:
    - *name*: name of the parameter.
    - *ensure*: present/absent. defaults to present.
    - *value*: value of the parameter.
    - *nonstandard*: inform postfix::config that this parameter is not recognized
      by the "postconf" command. defaults to false.
    
    Requires:
    - Class["postfix"]
    
    Example usage:
    
      node "toto.example.com" {
    
        include postfix
    
        postfix::config {
          "smtp_use_tls"            => "yes";
          "smtp_sasl_auth_enable"   => "yes";
          "smtp_sasl_password_maps" => "hash:/etc/postfix/my_sasl_passwords";
          "relayhost"               => "[mail.example.com]:587";
        }
      }
    
    */
    define postfix::config ($ensure = present, $value, $nonstandard = false) {
      case $ensure {
        present: {
          exec {"postconf -e ${name}='${value}'":
            unless  => $nonstandard ? {
              false => "test \"x$(postconf -h ${name})\" == 'x${value}'",
              true  => "test \"x$(egrep '^${name} ' /etc/postfix/main.cf | cut -d= -f2 | cut -d' ' -f2)\" == 'x${value}'",
            },
            notify  => Service["postfix"],
            require => File["/etc/postfix/main.cf"],
          }
        }
    
        absent: {
          fail "postfix::config ensure => absent: Not implemented"
        }
      }
    }