Defined Type: postfix::lookup::mysql
- Defined in:
- vendor_modules/postfix/manifests/lookup/mysql.pp
Overview
Define a MySQL lookup table.
24 25 26 27 28 29 30 31 32 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 60 61 62 63 64 65 66 |
# File 'vendor_modules/postfix/manifests/lookup/mysql.pp', line 24
define postfix::lookup::mysql (
Array[Postfix::Type::Lookup::MySQL::Host, 1] $hosts,
String $user,
String $password,
String $dbname,
String $query,
Enum['present', 'absent'] $ensure = 'present',
Stdlib::Absolutepath $path = $title,
Optional[String] $result_format = undef,
Optional[Array[String, 1]] $domain = undef,
Optional[Integer[0]] $expansion_limit = undef,
Optional[Stdlib::Absolutepath] $option_file = undef,
Optional[String] $option_group = undef,
Optional[Stdlib::Absolutepath] $tls_cert = undef,
Optional[Stdlib::Absolutepath] $tls_key = undef,
Optional[Stdlib::Absolutepath] $tls_ca_cert_file = undef,
Optional[Stdlib::Absolutepath] $tls_ca_cert_dir = undef,
Optional[Boolean] $tls_verify_cert = undef,
) {
include postfix
$_hosts = postfix::flatten_hosts($hosts)
$_ensure = $ensure ? {
'absent' => 'absent',
default => 'file',
}
file { $path:
ensure => $_ensure,
owner => 0,
group => 0,
mode => '0600',
content => template("${module_name}/mysql.cf.erb"),
}
if $ensure != 'absent' and has_key($postfix::lookup_packages, 'mysql') {
$mysql_package = $postfix::lookup_packages['mysql']
ensure_packages([$mysql_package])
Package[$mysql_package] -> File[$path]
}
}
|