Browse Source

Some config diffs between ubuntu and centos

Xabier de Zuazo 11 years ago
parent
commit
780328d994

+ 9 - 2
attributes/conf-10-ssl.rb

@@ -1,6 +1,13 @@
 
-default['dovecot']['conf']['ssl_cert'] = '</etc/ssl/certs/dovecot.pem'
-default['dovecot']['conf']['ssl_key'] = '</etc/ssl/private/dovecot.pem'
+case node['platform']
+  when 'redhat','centos','scientific','fedora','suse','amazon' then
+    default['dovecot']['conf']['ssl_cert'] = '</etc/pki/dovecot/certs/dovecot.pem'
+    default['dovecot']['conf']['ssl_key'] = '</etc/pki/dovecot/private/dovecot.pem'
+  # when 'debian', 'ubuntu' then
+  else
+    default['dovecot']['conf']['ssl_cert'] = '</etc/ssl/certs/dovecot.pem'
+    default['dovecot']['conf']['ssl_key'] = '</etc/ssl/private/dovecot.pem'
+end
 
 default['dovecot']['conf']['ssl'] = nil
 default['dovecot']['conf']['ssl_cert'] = nil

+ 8 - 1
templates/default/conf.d/10-mail.conf.erb

@@ -208,7 +208,14 @@
 <%= Dovecot::Conf.attribute(@conf, 'auth_socket_path', '/var/run/dovecot/auth-userdb') %>
 
 # Directory where to look up mail plugins.
-<%= Dovecot::Conf.attribute(@conf, 'mail_plugin_dir', '/usr/lib/dovecot/modules') %>
+<%= case node['platform']
+    when 'redhat','centos','scientific','fedora','suse','amazon' then
+      Dovecot::Conf.attribute(@conf, 'mail_plugin_dir', '/usr/lib/dovecot')
+    # when 'debian', 'ubuntu' then
+    else
+      Dovecot::Conf.attribute(@conf, 'mail_plugin_dir', '/usr/lib/dovecot/modules')
+    end
+%>
 
 # Space separated list of plugins to load for all services. Plugins specific to
 # IMAP, LDA, etc. are added to this list in their own .conf files.

+ 15 - 3
templates/default/conf.d/10-ssl.conf.erb

@@ -11,8 +11,20 @@
 # dropping root privileges, so keep the key file unreadable by anyone but
 # root. Included doc/mkcert.sh can be used to easily generate self-signed
 # certificate, just make sure to update the domains in dovecot-openssl.cnf
-<%= Dovecot::Conf.attribute(@conf, 'ssl_cert', '</etc/ssl/certs/dovecot.pem') %>
-<%= Dovecot::Conf.attribute(@conf, 'ssl_key', '</etc/ssl/private/dovecot.pem') %>
+<% case node['platform']
+    when 'redhat','centos','scientific','fedora','suse','amazon' then
+      ssl_cert = '</etc/pki/dovecot/certs/dovecot.pem'
+      ssl_key = '</etc/pki/dovecot/certs/dovecot.pem'
+      ca_pem = '</etc/pki/dovecot/certs/ca.pem'
+    # when 'debian', 'ubuntu' then
+    else
+      ssl_cert = '</etc/ssl/certs/dovecot.pem'
+      ssl_key = '</etc/ssl/private/dovecot.pem'
+      ca_pem = '</etc/ssl/certs/ca.pem'
+    end
+-%>
+<%= Dovecot::Conf.attribute(@conf, 'ssl_cert', ssl_cert) %>
+<%= Dovecot::Conf.attribute(@conf, 'ssl_key', ssl_key) %>
 
 # If key file is password protected, give the password here. Alternatively
 # give it when starting dovecot with -p parameter. Since this file is often
@@ -22,7 +34,7 @@
 
 # PEM encoded trusted certificate authority. Set this only if you intend to use
 # ssl_verify_client_cert=yes. The file should contain the CA certificate(s)
-# followed by the matching CRL(s). (e.g. ssl_ca = </etc/ssl/certs/ca.pem)
+# followed by the matching CRL(s). (e.g. ssl_ca = <%= ca_pem %>)
 <%= Dovecot::Conf.attribute(@conf, 'ssl_ca') %>
 
 # Request client to send a certificate. If you also want to require it, set