Skip to content

Commit

Permalink
Merge pull request #1 from fraenki/freebsd
Browse files Browse the repository at this point in the history
rebrand this fork to our own version, add FreeBSD support, use module data
  • Loading branch information
oxc committed Jan 29, 2018
2 parents aa774d8 + ce4a422 commit 03dc8f8
Show file tree
Hide file tree
Showing 14 changed files with 84 additions and 83 deletions.
12 changes: 2 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

1. [Description](#description)
1. [Setup - The basics of getting started with postfix](#setup)
* [What postfix affects](#what-postfix-affects)
* [Setup requirements](#setup-requirements)
* [Beginning with postfix](#beginning-with-postfix)
1. [Usage - Configuration options and additional functionality](#usage)
1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
1. [Limitations](#limitations)
Expand All @@ -25,12 +23,6 @@ Puppet module to manage your postfix installation. Manage main.cf settings and m

This module requires pluginsync to be enabled to sync the type/provider to the agent.

### Beginning with postfix

The very basic steps needed for a user to get the module up and running. This
can include setup steps, if necessary, or it can be an example of the most
basic use of the module.

## Usage

This section is where you describe how to customize, configure, and do the
Expand Down Expand Up @@ -111,6 +103,6 @@ As the postmulti the resource name must begin with `postfix-`.
## Limitations
### Known Issues

- The postfix version of el7 does not yet support postconf_master.
- The postfix version of el7 does not support postconf_master. An alternative version is available from the [IUS Community Project](https://ius.io/).

- The `puppet resource` interfacte is not working on postconf_master doe to [PUP-3732](https://tickets.puppetlabs.com/browse/PUP-3732)
- The `puppet resource` interface is not working on postconf_master due to [PUP-3732](https://tickets.puppetlabs.com/browse/PUP-3732).
2 changes: 2 additions & 0 deletions data/Debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
postfix::restart_cmd: '/etc/init.d/postfix reload'
3 changes: 3 additions & 0 deletions data/FreeBSD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
postfix::mailx_package: 'mail/heirloom-mailx'
postfix::restart_cmd: '/usr/sbin/service postfix reload'
2 changes: 2 additions & 0 deletions data/RedHat-6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
postfix::restart_cmd: '/etc/init.d/postfix reload'
2 changes: 2 additions & 0 deletions data/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
postfix::restart_cmd: '/bin/systemctl reload postfix'
2 changes: 2 additions & 0 deletions data/Suse-11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
postfix::restart_cmd: '/etc/init.d/postfix reload'
2 changes: 2 additions & 0 deletions data/Suse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
postfix::restart_cmd: '/usr/bin/systemctl reload postfix'
9 changes: 9 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
postfix::mailx_package: 'mailx'
postfix::mailx_ensure: present
postfix::mailx_manage: true
postfix::package_ensure: present
postfix::package_name: 'postfix'
postfix::service_ensure: running
postfix::service_manage: true
postfix::service_name: 'postfix'
23 changes: 23 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
version: 5

defaults:
datadir: 'data'
data_hash: 'yaml_data'

hierarchy:
- name: 'Distribution Name and Version'
path: '%{facts.os.name}-%{facts.os.release.major}.yaml'

- name: 'Distribution Name'
path: '%{facts.os.name}.yaml'

- name: 'Operating System Family and Version'
path: '%{facts.os.family}-%{facts.os.release.major}.yaml.yaml'

- name: 'Operating System Family'
path: '%{facts.os.family}.yaml'

- name: 'common'
path: 'common.yaml'

39 changes: 16 additions & 23 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,26 @@
# Authors
# -------
#
# Author Name <author@domain.com>
# Marius Rieder <marius.rieder@durchmesser.ch>
# Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
# Copyright
# ---------
#
# Copyright 2016 Your name here, unless otherwise noted.
# Copyright 2016 Marius Rieder <marius.rieder@durchmesser.ch>
# Copyright 2017 Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
class postfix (
### START Package Configuration ###
$package_ensure = present,
$package_name = $::postfix::params::package_name,
### END Package Configuration ###

### START Service Configuation ###
$service_ensure = running,
$service_name = undef,
$service_manage = true,
### END Service Configuration ###

### START mailx Configuration ###
$mailx_manage = true,
$mailx_ensure = present,
$mailx_package = $::postfix::params::mailx_package,
### END mailx Configuration ###
) inherits ::postfix::params {

class { '::postfix::package': }
-> class { '::postfix::service': }

Enum['installed', 'present', 'latest'] $mailx_ensure,
Boolean $mailx_manage,
String $mailx_package,
Enum['installed', 'present', 'latest'] $package_ensure,
String $package_name,
String $restart_cmd,
Enum['absent', 'running', 'stopped'] $service_ensure,
String $service_name,
Boolean $service_manage,
) {
Class { '::postfix::package': }
-> Class { '::postfix::service': }
}
4 changes: 3 additions & 1 deletion manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
# -------
#
# Marius Rieder <marius.rieder@durchmesser.ch>
# Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
# Copyright
# ---------
#
# Copyright 2016 Marius Rieder <marius.rieder@durchmesser.ch>
# Copyright 2017 Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
class postfix::package {
class postfix::package inherits postfix {
package { 'postfix':
ensure => $::postfix::package_ensure,
name => $::postfix::package_name,
Expand Down
36 changes: 0 additions & 36 deletions manifests/params.pp

This file was deleted.

16 changes: 9 additions & 7 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
# -------
#
# Marius Rieder <marius.rieder@durchmesser.ch>
# Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
# Copyright
# ---------
#
# Copyright 2016 Marius Rieder <marius.rieder@durchmesser.ch>
# Copyright 2017 Bernhard Frauendienst <puppet@nospam.obeliks.de>
#
class postfix::service {
class postfix::service inherits postfix {

$service_enable = $::postfix::service_ensure ? {
'running' => true,
Expand All @@ -30,16 +32,16 @@

if $::postfix::service_manage {
exec { 'restart postfix after packages install':
command => regsubst($::postfix::params::restart_cmd, 'reload', 'restart'),
command => regsubst($::postfix::restart_cmd, 'reload', 'restart'),
refreshonly => true,
subscribe => Package['postfix'],
}
service { 'postfix':
ensure => $service_ensure_real,
name => $::postfix::service_name,
enable => $service_enable,
hasstatus => true,
restart => $::postfix::params::restart_cmd,
ensure => $service_ensure_real,
name => $::postfix::service_name,
enable => $service_enable,
hasstatus => true,
restart => $::postfix::restart_cmd,
}
}

Expand Down
15 changes: 9 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
{
"name": "jiuka-postfix",
"name": "oxc-postfix",
"version": "0.1.0",
"author": "Marius Rieder",
"author": "Bernhard Frauendienst",
"summary": "Configure the postfix mailserver",
"license": "Apache-2.0",
"source": "https://github.com/jiuka/puppet-postfix",
"project_page": "https://github.com/jiuka/puppet-postfix",
"issues_url": "https://github.com/jiuka/puppet-postfix/issues",
"source": "https://github.com/oxc/puppet-postfix",
"project_page": "https://github.com/oxc/puppet-postfix",
"issues_url": "https://github.com/oxc/puppet-postfix/issues",
"tags": [
"postfix",
"postconf"
],
"operatingsystem_support": [
{
"operatingsystem": "FreeBSD"
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
Expand All @@ -29,7 +32,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 3.8.7 < 5.0.0"
"version_requirement": ">= 4.9.0 < 6.0.0"
}
],
"dependencies": [
Expand Down

0 comments on commit 03dc8f8

Please sign in to comment.