Commit 483bf90c authored by Ben Hocker's avatar Ben Hocker
Browse files

Fixes issue with postfix-ldap package

- Should only install on Debian based OS Family
- Should not install on RedHat based OS Family
parent b9fe74da
---
.travis.yml:
forge_password: "XAv4O363tng0KuRnu1ZhhwORy+2CF9UQwdwlFmS+NG9jOaTZZN+PMK8iC7OSIvZN6cfKlYjHRHNuxFBnYlnMrLsM9fVxt4NjjznOgIKQpQDleWk4UitZj5ntyHmUtYtofUd5Bhi/sdYXwGN9pVRCrcfFBmsIRq/dOhXD7Wy5KcQ="
#README.md:
# include: ['.sync/simple_usage.md', '.sync/classes.md']
## 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.
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',
}
## 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
......
# 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).
......@@ -2,8 +2,10 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec-puppet', '~> 2.0', :require => false
gem 'rspec', '< 3.2', :require => false if RUBY_VERSION =~ /^1.8/
gem 'rspec-puppet', :require => false
gem 'puppetlabs_spec_helper', :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
......@@ -14,15 +16,12 @@ group :development, :unit_tests do
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 'simplecov', :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
gem 'docker-api', '1.15.0', :require => false
end
group :system_tests do
gem 'beaker', :require => false, :git => 'https://github.com/raphink/beaker', :branch => 'openstack'
gem 'beaker', :require => false
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
end
......
# 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.
......@@ -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/>.
......@@ -2,14 +2,10 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
Rake::Task[:lint].clear
PuppetLint.configuration.fail_on_warnings
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_80chars')
PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
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
......@@ -31,8 +31,10 @@ define postfix::hash (
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}'")
......@@ -66,6 +68,7 @@ define postfix::hash (
exec {"generate ${name}.db":
command => "postmap ${name}",
path => $::path,
#creates => "${name}.db", # this prevents postmap from being run !
subscribe => File[$name],
refreshonly => true,
......
......@@ -82,7 +82,7 @@ class postfix (
$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
......
......@@ -14,9 +14,10 @@
# include postfix::ldap
#
class postfix::ldap {
case $::osfamily {
'debian': { package {'postfix-ldap': } }
default: {}
if $::osfamily == 'Debian' {
package {'postfix-ldap':
before => File['/etc/postfix/ldap-aliases.cf'],
}
}
if ! $postfix::ldap_base {
......@@ -38,6 +39,5 @@ class postfix::ldap {
owner => 'root',
group => 'postfix',
content => template('postfix/postfix-ldap-aliases.cf.erb'),
#TODO: Figure out if should have require package here
}
}
......@@ -35,7 +35,7 @@ class postfix::mta (
'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
......
......@@ -7,6 +7,11 @@ class postfix::params {
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"
......@@ -15,9 +20,11 @@ class postfix::params {
'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"
......@@ -26,6 +33,8 @@ class postfix::params {
'Suse': {
$seltype = undef
$restart_cmd = '/etc/init.d/postfix reload'
$mailx_package = 'mailx'
if $::operatingsystem != 'SLES' {
......
......@@ -3,6 +3,6 @@ class postfix::service {
ensure => running,
enable => true,
hasstatus => true,
restart => '/etc/init.d/postfix reload',
restart => $::postfix::params::restart_cmd,
}
}
{
"name": "camptocamp-postfix",
"version": "1.0.5",
"version": "1.1.1",
"author": "Camptocamp",
"summary": "Camptocamp Postfix Module",
"license": "Apache-2.0",
......@@ -48,7 +48,8 @@
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6"
"6",
"7"
]
}
],
......
......@@ -4,7 +4,7 @@ HOSTS:
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:
......
......@@ -4,7 +4,7 @@ HOSTS:
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
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
......@@ -4,7 +4,7 @@ HOSTS:
strict_variables:
platform: debian-7-amd64
hypervisor : openstack
flavor: m1.small
flavor: m1.medium
image: debian-7-amd64-20141121
user: debian
CONFIG:
......
......@@ -4,8 +4,7 @@ HOSTS:
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment