|
@@ -17,94 +17,130 @@
|
|
|
# limitations under the License.
|
|
|
#
|
|
|
|
|
|
+#
|
|
|
+# packages
|
|
|
+#
|
|
|
+
|
|
|
case node['platform']
|
|
|
when 'redhat','centos','scientific','fedora','suse','amazon' then
|
|
|
|
|
|
# core, imap, pop3, lmtp, ldap, sqlite
|
|
|
- package 'dovecot' do
|
|
|
+ ruby_block 'package-dovecot-core' do
|
|
|
+ block {}
|
|
|
+ notifies :install, 'package[dovecot]', :immediately
|
|
|
[ 'core', 'imap', 'pop3', 'lmtp', 'ldap' ].each do |conf_type|
|
|
|
node['dovecot']['conf_files'][conf_type].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
end
|
|
|
+ package 'dovecot' do action :nothing end
|
|
|
|
|
|
# sieve
|
|
|
- package 'dovecot-pigeonhole' do
|
|
|
+ ruby_block 'package-dovecot-sieve' do
|
|
|
+ block {}
|
|
|
only_if do Dovecot::Plugins.required?('sieve', node['dovecot']) end
|
|
|
+ notifies :install, 'package[dovecot-pigeonhole]', :immediately
|
|
|
node['dovecot']['conf_files']['sieve'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
+ package 'dovecot-pigeonhole' do action :nothing end
|
|
|
|
|
|
when 'debian', 'ubuntu' then
|
|
|
|
|
|
# core
|
|
|
- package 'dovecot-core' do
|
|
|
+ ruby_block 'package-dovecot-core' do
|
|
|
+ block {}
|
|
|
+ notifies :install, 'package[dovecot-core]', :immediately
|
|
|
+ notifies :install, 'package[dovecot-gssapi]', :immediately
|
|
|
node['dovecot']['conf_files']['core'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
- package 'dovecot-gssapi'
|
|
|
+ package 'dovecot-core' do action :nothing end
|
|
|
+ package 'dovecot-gssapi' do action :nothing end
|
|
|
|
|
|
# imap
|
|
|
- package 'dovecot-imapd' do
|
|
|
+ ruby_block 'package-dovecot-imap' do
|
|
|
+ block {}
|
|
|
only_if do Dovecot::Protocols.enabled?('imap', node['dovecot']['protocols']) end
|
|
|
+ notifies :install, 'package[dovecot-imapd]', :immediately
|
|
|
node['dovecot']['conf_files']['imap'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
+ package 'dovecot-imapd' do action :nothing end
|
|
|
|
|
|
# pop3
|
|
|
- package 'dovecot-pop3d' do
|
|
|
- only_if do Dovecot::Protocols.enabled?('pop3', node['dovecot']['protocols']) end
|
|
|
+ ruby_block 'package-dovecot-pop3d' do
|
|
|
+ block {}
|
|
|
+ only_if do Dovecot::Protocols.enabled?('pop3', node['dovecot']['protocols']) end
|
|
|
+ notifies :install, 'package[dovecot-pop3d]', :immediately
|
|
|
node['dovecot']['conf_files']['pop3'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
+ package 'dovecot-pop3d' do action :nothing end
|
|
|
|
|
|
# lmtp
|
|
|
- package 'dovecot-lmtpd' do
|
|
|
+ ruby_block 'package-dovecot-lmtpd' do
|
|
|
+ block {}
|
|
|
only_if do Dovecot::Protocols.enabled?('lmtp', node['dovecot']['protocols']) end
|
|
|
+ notifies :install, 'package[dovecot-lmtpd]', :immediately
|
|
|
node['dovecot']['conf_files']['lmtp'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
+ package 'dovecot-lmtpd' do action :nothing end
|
|
|
|
|
|
# sieve
|
|
|
- package 'dovecot-sieve' do
|
|
|
+ ruby_block 'package-dovecot-sieve' do
|
|
|
+ block {}
|
|
|
only_if do Dovecot::Plugins.required?('sieve', node['dovecot']) end
|
|
|
+ notifies :install, 'package[dovecot-sieve]', :immediately
|
|
|
+ notifies :install, 'package[dovecot-managesieved]', :immediately
|
|
|
node['dovecot']['conf_files']['sieve'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
- package 'dovecot-managesieved' do
|
|
|
- only_if do Dovecot::Plugins.required?('sieve', node['dovecot']) end
|
|
|
- end
|
|
|
+ package 'dovecot-sieve' do action :nothing end
|
|
|
+ package 'dovecot-managesieved' do action :nothing end
|
|
|
|
|
|
# ldap
|
|
|
- package 'dovecot-ldap' do
|
|
|
+ ruby_block 'package-dovecot-ldap' do
|
|
|
+ block {}
|
|
|
only_if do node['dovecot']['auth']['ldap'].kind_of?(Array) and node['dovecot']['auth']['ldap'].length > 0 end
|
|
|
+ notifies :install, 'package[dovecot-ldap]', :immediately
|
|
|
node['dovecot']['conf_files']['ldap'].each do |conf_file|
|
|
|
notifies :create, "template[#{conf_file}]", :immediately
|
|
|
end
|
|
|
end
|
|
|
+ package 'dovecot-ldap' do action :nothing end
|
|
|
|
|
|
# sqlite
|
|
|
- package 'dovecot-sqlite' do
|
|
|
+ ruby_block 'package-dovecot-sqlite' do
|
|
|
+ block {}
|
|
|
only_if do node['dovecot']['conf']['sql']['driver'] == 'sqlite' end
|
|
|
+ notifies :install, 'package[dovecot-sqlite]', :immediately
|
|
|
end
|
|
|
+ package 'dovecot-sqlite' do action :nothing end
|
|
|
|
|
|
else
|
|
|
- log('Unsupported platform, trying to guess dovecot packages') { level :warn }
|
|
|
- package 'dovecot'
|
|
|
+ Chef::Application.fatal!("Unsupported platform: #{node['platform']}");
|
|
|
end
|
|
|
|
|
|
-package 'dovecot-mysql' do
|
|
|
+ruby_block 'package-dovecot-mysql' do
|
|
|
+ block {}
|
|
|
only_if do node['dovecot']['conf']['sql']['driver'] == 'mysql' end
|
|
|
+ notifies :install, 'package[dovecot-mysql]', :immediately
|
|
|
end
|
|
|
+package 'dovecot-mysql' do action :nothing end
|
|
|
|
|
|
-package 'dovecot-pgsql' do
|
|
|
+ruby_block 'package-dovecot-pgsql' do
|
|
|
+ block {}
|
|
|
only_if do node['dovecot']['conf']['sql']['driver'] == 'pgsql' end
|
|
|
+ notifies :install, 'package[dovecot-pgsql]', :immediately
|
|
|
end
|
|
|
+package 'dovecot-pgsql' do action :nothing end
|
|
|
|