Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3763f18
Removing lucid from mailx_package selector
robruma Dec 14, 2014
17d424f
Update service.pp
dotmaster Jan 23, 2015
c0d887d
Add puppet-lint-leading_zero-check gem
raphink Feb 4, 2015
509405a
Update with modulesync
mcanevet Feb 4, 2015
a560b89
Clear lint rake task
mcanevet Feb 6, 2015
cd880c1
[ci skip] Fix hostname in nodesets
mcanevet Feb 6, 2015
89055a9
Modulesync
raphink Feb 10, 2015
b9fe74d
Resolves issue #55
benhocker Feb 11, 2015
9057ca2
Fix puppet-lint configuration
mcanevet Feb 18, 2015
0475b2e
Add puppet-lint-version_comparison-check gem
raphink Feb 19, 2015
b6abe5d
Use unreleased puppetlabs_spec_helper
mcanevet Feb 19, 2015
b58efdd
Fix metadata rake task
mcanevet Feb 19, 2015
a9bc4f9
Release 1.1.0
raphink Feb 19, 2015
c4d9d89
Update with msync
mcanevet Feb 24, 2015
d69302c
Use puppetlabs_spec_helper's gem
mcanevet Feb 25, 2015
79bddaa
Add metadata-json-lint to Gemfile
mcanevet Feb 25, 2015
1f688a0
Pin rspec version to 3.1.0 (https://github.com/rspec/rspec-core/issue…
mcanevet Feb 25, 2015
daaff52
add logic to set the restart_cmd variable appropriately for each osfa…
Mar 4, 2015
aae2f6f
replace the restart command with the variable from params
Mar 4, 2015
cd2a6f8
fix the test so it checks for the correct restart value for redhat 7
Mar 4, 2015
9705585
fix validation for source and content vars
Mar 5, 2015
314b330
Update beaker pinning as release contains all our patches
mcanevet Mar 5, 2015
5fcb57b
README includes
raphink Mar 10, 2015
b77a068
Add .sync
raphink Mar 10, 2015
ec47dea
Update
raphink Mar 10, 2015
7ad891b
Update .sync.yml
mcanevet Mar 24, 2015
d5241eb
Update with msync
mcanevet Mar 24, 2015
60140c1
Update README [skip ci]
raphink Mar 24, 2015
55e48b4
Release 1.1.1
raphink Mar 24, 2015
12e0ce2
Fix issue with multiple mynetworks.
erinn Nov 12, 2014
a0958dc
Introduce IPv6 supporting defaults for mynetworks
lazyfrosch Mar 6, 2015
5d2a8d5
Quality the postmap command in postfix::hash
raphink Mar 25, 2015
4fe2171
Merge pull request #62 from robruma/bugfix/lucid_mailx_package
mcanevet Mar 25, 2015
afc7a1e
Merge pull request #67 from dotmaster/patch-1
mcanevet Mar 25, 2015
a127562
Revert "Update service.pp"
mcanevet Mar 25, 2015
32ebb5d
Merge pull request #86 from camptocamp/revert-67-patch-1
mcanevet Mar 25, 2015
be33e7e
Merge pull request #78 from smithtrevor/systemd_restart_support
mcanevet Mar 25, 2015
745509f
Merge pull request #79 from oferzi23/master
mcanevet Mar 25, 2015
e81564f
Manage unit tests with rspec-puppet-facts
mcanevet Mar 25, 2015
37052f4
Confine rspec pinning to ruby18
mcanevet Mar 26, 2015
61761ea
Cleaning up code
benhocker Mar 28, 2015
ae21bd3
Merge branch 'upstream_master' into issue-postfixldap
benhocker Mar 28, 2015
7095378
Updating before
benhocker Mar 28, 2015
483bf90
Fixes issue with postfix-ldap package
benhocker Mar 28, 2015
97d27ef
Merge branch 'issue-postfixldap' of https://github.com/phathocker/pup…
benhocker Mar 28, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
.travis.yml:
forge_password: "XAv4O363tng0KuRnu1ZhhwORy+2CF9UQwdwlFmS+NG9jOaTZZN+PMK8iC7OSIvZN6cfKlYjHRHNuxFBnYlnMrLsM9fVxt4NjjznOgIKQpQDleWk4UitZj5ntyHmUtYtofUd5Bhi/sdYXwGN9pVRCrcfFBmsIRq/dOhXD7Wy5KcQ="
#README.md:
# include: ['.sync/simple_usage.md', '.sync/classes.md']
24 changes: 24 additions & 0 deletions .sync/classes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Classes

### postfix

The top-level class, to install and configure Postfix.

## Definitions

### postfix::config

Add/alter/remove options in Postfix main configuration file (main.cf)

### postfix::hash

Creates Postfix hashed "map" files, and build the corresponding db file.

### postfix::transport

Manages content in the transport map.

### postfix::virtual

Manages content in the virtual map.

22 changes: 22 additions & 0 deletions .sync/simple_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
This module requires Augeas.

## Simple usage

include postfix

postfix::config { "relay_domains": value => "localhost host.foo.com" }

## Exec paths

In order to not have any path problem, you should add the following line in
some globally included .pp file:

Exec {
path => '/some/relevant/path:/some/other:...',
}

For example:

Exec {
path => '/bin:/sbin:/usr/sbin:/usr/bin',
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2015-03-24 - Release 1.1.1

- Various spec improvements

## 2015-02-19 - Release 1.1.0

- Various specs improvements
- Fix specs for postfix::config with ensure => blank
- Simplify relationships and avoid spaceship operators
- nexthop parameter is not necessary for postfix::canonical

## 2015-01-07 - Release 1.0.5

- Fix unquoted strings in cases
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# How to contribute

Please report bugs and feature request using [GitHub issue
tracker](https://github.com/camptocamp/puppet-postfix/issues).

For pull requests, it is very much appreciated to check your Puppet manifest
with [puppet-lint](https://github.com/rodjek/puppet-lint) to follow the recommended Puppet style guidelines from the
[Puppet Labs style guide](http://docs.puppetlabs.com/guides/style_guide.html).
15 changes: 9 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,26 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-puppet', :require => false, :git => 'https://github.com/camptocamp/rspec-puppet.git', :branch => 'rspec3'
gem 'rspec', '< 3.2', :require => false if RUBY_VERSION =~ /^1.8/
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 1.0.0', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-lint', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-spaceship_operator_without_tag-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
gem 'puppet-lint-undef_in_function-check', :require => false
gem 'simplecov', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-trailing_comma-check', :require => false
gem 'puppet-lint-file_ensure-check', :require => false
gem 'puppet-lint-version_comparison-check', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'json', :require => false
gem 'metadata-json-lint', :require => false
end

group :system_tests do
gem 'beaker', :require => false, :git => 'https://github.com/mcanevet/beaker', :branch => 'openstack'
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
end
Expand Down
38 changes: 6 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Postfix module for Puppet
# Postfix Puppet Module

[![Puppet Forge](http://img.shields.io/puppetforge/v/camptocamp/postfix.svg)](https://forge.puppetlabs.com/camptocamp/postfix)
[![Build Status](https://travis-ci.org/camptocamp/puppet-postfix.png?branch=master)](https://travis-ci.org/camptocamp/puppet-postfix)

**Manages Postfix configuration.**

This module is provided by [Camptocamp](http://www.camptocamp.com/)
[![Puppet Forge Version](http://img.shields.io/puppetforge/v/camptocamp/postfix.svg)](https://forge.puppetlabs.com/camptocamp/postfix)
[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/camptocamp/postfix.svg)](https://forge.puppetlabs.com/camptocamp/postfix)
[![Build Status](https://img.shields.io/travis/camptocamp/puppet-postfix/master.svg)](https://travis-ci.org/camptocamp/puppet-postfix)
[![Gemnasium](https://img.shields.io/gemnasium/camptocamp/puppet-postfix.svg)](https://gemnasium.com/camptocamp/puppet-postfix)
[![By Camptocamp](https://img.shields.io/badge/by-camptocamp-fb7047.svg)](http://www.camptocamp.com)

This module requires Augeas.

Expand Down Expand Up @@ -54,29 +53,4 @@ Manages content in the transport map.

Manages content in the virtual map.

## Contributing

Please report bugs and feature request using [GitHub issue
tracker](https://github.com/camptocamp/puppet-postfix/issues).

For pull requests, it is very much appreciated to check your Puppet manifest
with [puppet-lint](https://github.com/camptocamp/puppet-postfix/issues) to follow the recommended Puppet style guidelines from the
[Puppet Labs style guide](http://docs.puppetlabs.com/guides/style_guide.html).

## License

Copyright (c) 2013 <mailto:puppet@camptocamp.com> All rights reserved.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

15 changes: 6 additions & 9 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'

PuppetLint.configuration.fail_on_warnings
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
Rake::Task[:lint].clear
PuppetLint::RakeTask.new :lint do |config|
config.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
config.disable_checks = ['80chars']
config.fail_on_warnings = true
end

PuppetSyntax.exclude_paths = ["spec/fixtures/**/*.pp", "vendor/**/*"]

desc "Lint metadata.json file"
task :metadata do
sh "metadata-json-lint metadata.json"
end
7 changes: 5 additions & 2 deletions manifests/hash.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
include ::postfix::params

validate_absolute_path($name)
validate_string($source)
validate_string($content)
# validate_string($source)
# validate_string($content)
if !is_string($source) and !is_array($source) { fail("value for source should be either String type or Array type got ${source}") }
if !is_string($content) and !is_array($content) { fail("value for source should be either String type or Array type got ${content}") }
validate_string($ensure)
validate_re($ensure, ['present', 'absent'],
"\$ensure must be either 'present' or 'absent', got '${ensure}'")
Expand Down Expand Up @@ -66,6 +68,7 @@

exec {"generate ${name}.db":
command => "postmap ${name}",
path => $::path,
#creates => "${name}.db", # this prevents postmap from being run !
subscribe => File[$name],
refreshonly => true,
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
$master_submission = undef, # postfix_master_submission
$mta = false,
$mydestination = '$myorigin', # postfix_mydestination
$mynetworks = '127.0.0.0/8', # postfix_mynetworks
$mynetworks = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', # postfix_mynetworks
$myorigin = $::fqdn,
$relayhost = undef, # postfix_relayhost
$root_mail_recipient = 'nobody', # root_mail_recipient
Expand Down
8 changes: 5 additions & 3 deletions manifests/ldap.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
# include postfix::ldap
#
class postfix::ldap {

package {'postfix-ldap': }
if $::osfamily == 'Debian' {
package {'postfix-ldap':
before => File['/etc/postfix/ldap-aliases.cf'],
}
}

if ! $postfix::ldap_base {
fail 'Missing $postfix::ldap_base !'
Expand All @@ -36,6 +39,5 @@
owner => 'root',
group => 'postfix',
content => template('postfix/postfix-ldap-aliases.cf.erb'),
require => Package['postfix-ldap'],
}
}
2 changes: 1 addition & 1 deletion manifests/mta.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
'Wrong value for $relayhost')
validate_re($mydestination, '^\S+(?:,\s*\S+)*$',
'Wrong value for $mydestination')
validate_re($mynetworks, '^\S+$',
validate_re($mynetworks, '^(?:\S+?(?:(?:,\s)|(?:\s))?)*$',
'Wrong value for $mynetworks')

# If direct is specified then relayhost should be blank
Expand Down
13 changes: 11 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
default => undef,
}

$restart_cmd = $::operatingsystemmajrelease ? {
'7' => '/bin/systemctl reload postfix',
default => '/etc/init.d/postfix reload',
}

$mailx_package = 'mailx'

$master_os_template = "${module_name}/master.cf.redhat.erb"
Expand All @@ -15,9 +20,11 @@
'Debian': {
$seltype = undef

$restart_cmd = '/etc/init.d/postfix reload'

$mailx_package = $::lsbdistcodename ? {
/sarge|etch|lenny|lucid/ => 'mailx',
default => 'bsd-mailx',
/sarge|etch|lenny/ => 'mailx',
default => 'bsd-mailx',
}

$master_os_template = "${module_name}/master.cf.debian.erb"
Expand All @@ -26,6 +33,8 @@
'Suse': {
$seltype = undef

$restart_cmd = '/etc/init.d/postfix reload'

$mailx_package = 'mailx'

if $::operatingsystem != 'SLES' {
Expand Down
2 changes: 1 addition & 1 deletion manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
ensure => running,
enable => true,
hasstatus => true,
restart => '/etc/init.d/postfix reload',
restart => $::postfix::params::restart_cmd,
}
}
5 changes: 3 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "camptocamp-postfix",
"version": "1.0.5",
"version": "1.1.1",
"author": "Camptocamp",
"summary": "Camptocamp Postfix Module",
"license": "Apache-2.0",
Expand Down Expand Up @@ -48,7 +48,8 @@
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6"
"6",
"7"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/nodesets/centos-7-x86_64-docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HOSTS:
centos-7-x86_64:
centos-7-x64:
default_apply_opts:
strict_variables:
platform: el-7-x86_64
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/centos-7-x86_64-openstack.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HOSTS:
centos-7-x86_64:
centos-7-x64:
default_apply_opts:
strict_variables:
platform: el-7-x86_64
hypervisor : openstack
flavor: m1.small
flavor: m1.medium
image: centos-7-x86_64-genericcloud-20140929_01
user: centos
CONFIG:
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/centos-7-x86_64-vagrant.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HOSTS:
centos-7-x86_64:
centos-7-x64:
default_apply_opts:
strict_variables:
platform: el-7-x86_64
hypervisor : vagrant
box : puppetlabs/centos-6.5-64-nocm
box : puppetlabs/centos-7.0-64-nocm
CONFIG:
type: foss
log_level: debug
2 changes: 1 addition & 1 deletion spec/acceptance/nodesets/debian-6-x86_64-docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HOSTS:
debian-6-x86_64:
debian-6-x64:
default_apply_opts:
strict_variables:
platform: debian-6-amd64
Expand Down
10 changes: 10 additions & 0 deletions spec/acceptance/nodesets/debian-6-x86_64-vagrant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
HOSTS:
debian-6-x64:
default_apply_opts:
strict_variables:
platform: debian-6-amd64
hypervisor : vagrant
box : puppetlabs/debian-6.0.10-64-nocm
CONFIG:
type: foss
log_level: debug
2 changes: 1 addition & 1 deletion spec/acceptance/nodesets/debian-7-x86_64-docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HOSTS:
debian-7-x86_64:
debian-7-x64:
default_apply_opts:
strict_variables:
platform: debian-7-amd64
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/nodesets/debian-7-x86_64-openstack.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
HOSTS:
debian-7-x86_64:
debian-7-x64:
default_apply_opts:
strict_variables:
platform: debian-7-amd64
hypervisor : openstack
flavor: m1.small
flavor: m1.medium
image: debian-7-amd64-20141121
user: debian
CONFIG:
Expand Down
5 changes: 2 additions & 3 deletions spec/acceptance/nodesets/debian-7-x86_64-vagrant.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
HOSTS:
debian-7-x86_64:
debian-7-x64:
default_apply_opts:
strict_variables:
platform: debian-7-amd64
hypervisor : vagrant
box : debian-73-x64-virtualbox-nocm
box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box
box : puppetlabs/debian-7.8-64-nocm
CONFIG:
type: foss
log_level: debug
2 changes: 1 addition & 1 deletion spec/acceptance/nodesets/debian-8-x86_64-docker.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
HOSTS:
debian-8-x86_64:
debian-8-x64:
default_apply_opts:
strict_variables:
platform: debian-8-amd64
Expand Down
Loading