From 7208c3f559a6a4a17f00c5b3530fa8c69ff3ec46 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Sun, 11 Oct 2020 10:44:22 -0700 Subject: [PATCH] Fix OpenSUSE installation issues OpenSUSE runs a script which builds the main.cf file automatically if a file doesn't exist. This breaks idempotency so go ahead and touch the file via Chef. In addition, postfix is built with incorrect default settings for `setgid_group` and `daemon_directory`, so set it properly in the config. Signed-off-by: Lance Albertson --- CHANGELOG.md | 1 + attributes/default.rb | 3 +++ recipes/_common.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5270112..c51c1fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - ChefSpec fixes - Yamllint fixes - MDL fixes +- Fix OpenSUSE installation issues ### Removed diff --git a/attributes/default.rb b/attributes/default.rb index 592b09e..d6f7eb8 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -105,6 +105,9 @@ when 'rhel' default['postfix']['cafile'] = '/etc/pki/tls/cert.pem' when 'amazon' default['postfix']['cafile'] = '/etc/pki/tls/cert.pem' +when 'suse' + default['postfix']['main']['setgid_group'] = 'maildrop' + default['postfix']['main']['daemon_directory'] = '/usr/lib/postfix/bin' else default['postfix']['cafile'] = "#{node['postfix']['conf_dir']}/cacert.pem" end diff --git a/recipes/_common.rb b/recipes/_common.rb index 1361292..88d6eee 100644 --- a/recipes/_common.rb +++ b/recipes/_common.rb @@ -42,6 +42,8 @@ when 'rhel', 'fedora', 'amazon' notifies :start, 'service[postfix]' not_if '/usr/bin/test /etc/alternatives/mta -ef /usr/sbin/sendmail.postfix' end +when 'suse' + file '/var/adm/postfix.configured' when 'omnios' manifest_path = ::File.join(Chef::Config[:file_cache_path], 'manifest-postfix.xml')