Skip to content
Snippets Groups Projects
Commit b139cac8 authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Simplify relationships and avoid spaceship operators

parent a863c1b3
No related branches found
No related tags found
No related merge requests found
......@@ -42,28 +42,27 @@ define postfix::config ($value = undef, $ensure = 'present') {
fail 'You must define class postfix before using postfix::config!'
}
Augeas {
incl => '/etc/postfix/main.cf',
lens => 'Postfix_Main.lns',
require => File['/etc/postfix/main.cf'],
}
case $ensure {
'present': {
augeas { "set postfix '${name}' to '${value}'":
changes => "set ${name} '${value}'",
}
$changes = "set ${name} '${value}'"
}
'absent': {
augeas { "rm postfix '${name}'":
changes => "rm ${name}",
}
$changes = "rm ${name}"
}
'blank': {
augeas { "blank postfix '${name}'":
changes => "clear ${name}",
$changes = "clear ${name}"
}
default: {
fail "Unknown value for ensure '${ensure}'"
}
default: {}
}
augeas { "manage postfix '${title}'":
incl => '/etc/postfix/main.cf',
lens => 'Postfix_Main.lns',
changes => $changes,
require => File['/etc/postfix/main.cf'],
}
Postfix::Config[$title] ~> Class['postfix::service']
}
......@@ -70,4 +70,6 @@ define postfix::hash (
subscribe => File[$name],
refreshonly => true,
}
Class['postfix'] -> Postfix::Hash[$title]
}
......@@ -162,8 +162,4 @@ class postfix (
if $mailman {
include ::postfix::mailman
}
# Relationships
Postfix::Config <| |> ~> Class['postfix::service']
Class['postfix'] -> Postfix::Hash <| |>
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment