Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Puppet Camptocamp Postfix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Projets publics
Puppet Camptocamp Postfix
Commits
fa2f200a
Commit
fa2f200a
authored
Jun 22, 2015
by
Mickaël Canévet
Browse files
Options
Downloads
Plain Diff
Merge pull request #98 from mremy/master
Use RHEL SELinux type for /etc/aliases
parents
ca91225b
a6700444
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
manifests/files.pp
+1
-1
1 addition, 1 deletion
manifests/files.pp
manifests/params.pp
+8
-1
8 additions, 1 deletion
manifests/params.pp
spec/classes/postfix_spec.rb
+11
-1
11 additions, 1 deletion
spec/classes/postfix_spec.rb
with
20 additions
and
3 deletions
manifests/files.pp
+
1
−
1
View file @
fa2f200a
...
@@ -32,7 +32,7 @@ class postfix::files {
...
@@ -32,7 +32,7 @@ class postfix::files {
content
=>
"# file managed by puppet
\n
"
,
content
=>
"# file managed by puppet
\n
"
,
notify
=>
Exec
[
'newaliases'
],
notify
=>
Exec
[
'newaliases'
],
replace
=>
false
,
replace
=>
false
,
seltype
=>
$postfix::params::seltype
,
seltype
=>
$postfix::params::
aliases
seltype
,
}
}
# Aliases
# Aliases
...
...
This diff is collapsed.
Click to expand it.
manifests/params.pp
+
8
−
1
View file @
fa2f200a
class
postfix::params
{
class
postfix::params
{
case
$::osfamily
{
case
$::osfamily
{
'RedHat'
:
{
'RedHat'
:
{
$aliasesseltype
=
$::operatingsystemmajrelease
?
{
'4'
=>
'etc_t'
,
/5/
=>
'postfix_etc_t'
,
/6|7/
=>
'etc_aliases_t'
,
default
=>
undef
,
}
$seltype
=
$::operatingsystemmajrelease
?
{
$seltype
=
$::operatingsystemmajrelease
?
{
'4'
=>
'etc_t'
,
'4'
=>
'etc_t'
,
/5|6|7/
=>
'postfix_etc_t'
,
/5|6|7/
=>
'postfix_etc_t'
,
...
...
This diff is collapsed.
Click to expand it.
spec/classes/postfix_spec.rb
+
11
−
1
View file @
fa2f200a
...
@@ -35,7 +35,6 @@ describe 'postfix' do
...
@@ -35,7 +35,6 @@ describe 'postfix' do
)
}
)
}
else
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/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/master.cf'
).
with_seltype
(
'postfix_etc_t'
)
}
it
{
is_expected
.
to
contain_file
(
'/etc/postfix/main.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
...
@@ -45,6 +44,7 @@ describe 'postfix' do
case
facts
[
:operatingsystemmajrelease
]
case
facts
[
:operatingsystemmajrelease
]
when
'7'
when
'7'
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'etc_aliases_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
is_expected
.
to
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
:ensure
=>
'running'
,
...
@@ -52,7 +52,17 @@ describe 'postfix' do
...
@@ -52,7 +52,17 @@ describe 'postfix' do
:hasstatus
=>
'true'
,
:hasstatus
=>
'true'
,
:restart
=>
'/bin/systemctl reload postfix'
: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
else
it
{
is_expected
.
to
contain_file
(
'/etc/aliases'
).
with_seltype
(
'postfix_etc_t'
).
with_content
(
"# file managed by puppet
\n
"
)
}
it
{
it
{
is_expected
.
to
contain_service
(
'postfix'
).
with
(
is_expected
.
to
contain_service
(
'postfix'
).
with
(
:ensure
=>
'running'
,
:ensure
=>
'running'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment