Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Puppet Camptocamp Postfix
Commits
04c76b10
Commit
04c76b10
authored
May 27, 2013
by
Raphaël Pinson
Browse files
Add $mta and $satellite parameters to the postfix class
parent
70058f1d
Changes
4
Hide whitespace changes
Inline
Side-by-side
manifests/init.pp
View file @
04c76b10
...
...
@@ -29,6 +29,11 @@ class postfix (
$master_smtp
=
undef
,
# postfix_master_smtp
$master_smtps
=
undef
,
# postfix_master_smtps
$master_submission
=
undef
,
# postfix_master_submission
$relayhost
=
undef
,
# postfix_relayhost
$mydestination
=
undef
,
# postfix_mydestination
$mynetworks
=
undef
,
# postfix_mynetworks
$mta
=
false
,
$satellite
=
false
,
)
inherits
postfix::params
{
validate_string
(
$smtp_listen
)
...
...
@@ -42,6 +47,12 @@ class postfix (
validate_string
(
$inet_interfaces
)
validate_string
(
$master_smtp
)
validate_string
(
$master_smtps
)
validate_string
(
$relayhost
)
validate_string
(
$mydestination
)
validate_string
(
$mynetworks
)
validate_bool
(
$mta
)
validate_bool
(
$satellite
)
class
{
'postfix::packages'
:
}
->
class
{
'postfix::files'
:
...
...
@@ -60,4 +71,12 @@ class postfix (
}
~>
class
{
'postfix::service'
:
}
->
Class
[
'postfix'
]
if
$mta
{
include
::postfix::mta
}
if
$satellite
{
include
::postfix::satellite
}
}
manifests/mta.pp
View file @
04c76b10
...
...
@@ -32,27 +32,17 @@
#
class
postfix::mta
{
case
$postfix_relayhost
{
''
:
{
fail
(
'Required $postfix_relayhost variable is not defined.'
)
}
default
:
{}
}
case
$postfix_mydestination
{
''
:
{
$postfix_mydestination
=
'$myorigin'
}
default
:
{}
}
case
$postfix_mynetworks
{
""
:
{
$postfix_mynetworks
=
"127.0.0.0/8"
}
default
:
{}
}
include
postfix
validate_re
(
$postfix::relayhost
,
'^\S+$'
,
'You must pass $relayhost to the postfix class'
)
validate_re
(
$postfix::mydestination
,
'^\S+$'
,
'You must pass $mydestination to the postfix class'
)
validate_re
(
$postfix::mynetworks
,
'^\S+$'
,
'You must pass $mynetworks to the postfix class'
)
postfix::config
{
'mydestination'
:
value
=>
$postfix
_
mydestination
;
'mynetworks'
:
value
=>
$postfix
_
mynetworks
;
'relayhost'
:
value
=>
$postfix
_
relayhost
;
'mydestination'
:
value
=>
$postfix
::
mydestination
;
'mynetworks'
:
value
=>
$postfix
::
mynetworks
;
'relayhost'
:
value
=>
$postfix
::
relayhost
;
'virtual_alias_maps'
:
value
=>
'hash:/etc/postfix/virtual'
;
'transport_maps'
:
value
=>
'hash:/etc/postfix/transport'
;
}
...
...
spec/classes/postfix_satellite_spec.rb
View file @
04c76b10
require
'spec_helper'
describe
'postfix::satellite'
do
let
(
:node
)
{
'foo.example.com'
}
let
(
:facts
)
{
{
:osfamily
=>
'Debian'
,
:needs_postfix_class
=>
true
,
:osfamily
=>
'Debian'
,
:needs_postfix_class
_with_params
=>
true
,
}
}
it
{
should
include_class
(
'postfix::mta'
)
}
it
{
should
contain_postfix__virtual
(
'@foo.example.com'
).
with
(
...
...
spec/fixtures/manifests/site.pp
View file @
04c76b10
...
...
@@ -3,3 +3,11 @@ include ::augeas
if
$::needs_postfix_class
{
include
::postfix
}
if
$::needs_postfix_class_with_params
{
class
{
'::postfix'
:
relayhost
=>
'foo'
,
mydestination
=>
'bar'
,
mynetworks
=>
'baz'
,
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment