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
fa2f200a
Commit
fa2f200a
authored
Jun 22, 2015
by
Mickaël Canévet
Browse files
Merge pull request #98 from mremy/master
Use RHEL SELinux type for /etc/aliases
parents
ca91225b
a6700444
Changes
3
Hide whitespace changes
Inline
Side-by-side
manifests/files.pp
View file @
fa2f200a
...
...
@@ -32,7 +32,7 @@ class postfix::files {
content
=>
"# file managed by puppet
\n
"
,
notify
=>
Exec
[
'newaliases'
],
replace
=>
false
,
seltype
=>
$postfix::params::seltype
,
seltype
=>
$postfix::params::
aliases
seltype
,
}
# Aliases
...
...
manifests/params.pp
View file @
fa2f200a
class
postfix::params
{
case
$::osfamily
{
'RedHat'
:
{
$aliasesseltype
=
$::operatingsystemmajrelease
?
{
'4'
=>
'etc_t'
,
/5/
=>
'postfix_etc_t'
,
/6|7/
=>
'etc_aliases_t'
,
default
=>
undef
,
}
$seltype
=
$::operatingsystemmajrelease
?
{
'4'
=>
'etc_t'
,
'4'
=>
'etc_t'
,
/5|6|7/
=>
'postfix_etc_t'
,
default
=>
undef
,
}
...
...
spec/classes/postfix_spec.rb
View file @
fa2f200a
...
...
@@ -35,7 +35,6 @@ describe 'postfix' do
)
}
else
it
{
is_expected
.
to
contain_file
(
'/etc/mailname'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"foo.example.com
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/postfix/master.cf'
).
with_seltype
(
'postfix_etc_t'
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/postfix/main.cf'
).
with_seltype
(
'postfix_etc_t'
)
}
...
...
@@ -45,6 +44,7 @@ describe 'postfix' do
case
facts
[
:operatingsystemmajrelease
]
when
'7'
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
...
...
@@ -52,7 +52,17 @@ describe 'postfix' do
:hasstatus
=>
'true'
,
:restart
=>
'/bin/systemctl reload postfix'
)
}
when
'6'
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
:enable
=>
'true'
,
:hasstatus
=>
'true'
,
:restart
=>
'/etc/init.d/postfix reload'
)
}
else
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
...
...
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