Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(opensuse): fixes config files generation in opensuse #112

Merged
merged 1 commit into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 postfix/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ postfix:
postsrsd_pkg: postsrsd
postgrey_pkg: postgrey
root_grp: root
setgid_group: postdrop
daemon_directory: /usr/libexec/postfix
service: postfix
xbin_prefix: /usr
dovecot_deliver: /usr/lib/dovecot/deliver
5 changes: 5 additions & 0 deletions postfix/files/main.cf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@

{{ set_parameter('readme_directory', 'no') }}

# Apply default setgid_group
{{ set_parameter('setgid_group', postfix.setgid_group) }}
# Set daemon directory
{{ set_parameter('daemon_directory', postfix.daemon_directory) }}

{%- set relay_restrictions = ['permit_mynetworks'] %}
{%- set recipient_restrictions = ['permit_mynetworks'] %}

Expand Down
15 changes: 14 additions & 1 deletion postfix/init.sls
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
{% from "postfix/map.jinja" import postfix with context %}

{%- if grains.os_family == "Suse" %}
# The existence of this file prevents the system to
# overwrite files from salt when installing.
/var/adm/postfix.configured:
file.managed:
- contents: ''
- mode: '0644'
- user: 'root'
- group: 'root'
- require_in:
- pkg: postfix
{%- endif %}

postfix:
pkg.installed:
- name: {{ postfix.package }}
{%- if grains['os_family']=="FreeBSD" %}
{%- if grains.os_family == "FreeBSD" %}
- force: True
- batch: True
{%- endif %}
Expand Down
7 changes: 7 additions & 0 deletions postfix/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
---
Arch:
policyd_spf_pkg: python-postfix-policyd-spf
daemon_directory: /usr/lib/postfix/bin

Debian:
policyd_spf_pkg: postfix-policyd-spf-python
pcre_pkg: postfix-pcre
mysql_pkg: postfix-mysql
daemon_directory: /usr/lib/postfix/sbin

FreeBSD:
policyd_spf_pkg: py27-postfix-policyd-spf-python
aliases_file: /etc/mail/aliases
xbin_prefix: /usr/local
config_path: /usr/local/etc/postfix
root_grp: wheel
daemon_directory: /usr/local/libexec/postfix
dovecot_deliver: /usr/local/libexec/dovecot/deliver

Gentoo:
Expand All @@ -27,3 +30,7 @@ Gentoo:

RedHat:
policyd_spf_pkg: pypolicyd-spf

Suse:
setgid_group: maildrop
daemon_directory: /usr/lib/postfix/bin