Update upstream cookbooks

This commit is contained in:
Greg Karékinian
2017-03-20 13:19:10 +00:00
parent bfd2d52ea8
commit bcfd44b923
340 changed files with 12576 additions and 5465 deletions

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright 2012-2014, Chef Software, Inc.
# Copyright:: 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,46 +14,58 @@
#
if node['postfix']['use_procmail']
node.default['postfix']['main']['mailbox_command'] = '/usr/bin/procmail -a "$EXTENSION"'
node.default_unless['postfix']['main']['mailbox_command'] = '/usr/bin/procmail -a "$EXTENSION"'
end
if node['postfix']['main']['smtpd_use_tls'] == 'yes'
node.default['postfix']['main']['smtpd_tls_cert_file'] = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
node.default['postfix']['main']['smtpd_tls_key_file'] = '/etc/ssl/private/ssl-cert-snakeoil.key'
node.default['postfix']['main']['smtpd_tls_CAfile'] = node['postfix']['cafile']
node.default['postfix']['main']['smtpd_tls_session_cache_database'] = 'btree:${data_directory}/smtpd_scache'
node.default_unless['postfix']['main']['smtpd_tls_cert_file'] = '/etc/ssl/certs/ssl-cert-snakeoil.pem'
node.default_unless['postfix']['main']['smtpd_tls_key_file'] = '/etc/ssl/private/ssl-cert-snakeoil.key'
node.default_unless['postfix']['main']['smtpd_tls_CAfile'] = node['postfix']['cafile']
node.default_unless['postfix']['main']['smtpd_tls_session_cache_database'] = 'btree:${data_directory}/smtpd_scache'
end
if node['postfix']['main']['smtp_use_tls'] == 'yes'
node.default['postfix']['main']['smtp_tls_CAfile'] = node['postfix']['cafile']
node.default['postfix']['main']['smtp_tls_session_cache_database'] = 'btree:${data_directory}/smtp_scache'
node.default_unless['postfix']['main']['smtp_tls_CAfile'] = node['postfix']['cafile']
node.default_unless['postfix']['main']['smtp_tls_session_cache_database'] = 'btree:${data_directory}/smtp_scache'
end
if node['postfix']['main']['smtp_sasl_auth_enable'] == 'yes'
node.default['postfix']['sasl_password_file'] = "#{node['postfix']['conf_dir']}/sasl_passwd"
node.default['postfix']['main']['smtp_sasl_password_maps'] = "hash:#{node['postfix']['sasl_password_file']}"
node.default['postfix']['main']['smtp_sasl_security_options'] = 'noanonymous'
node.default['postfix']['sasl']['smtp_sasl_user_name'] = ''
node.default['postfix']['sasl']['smtp_sasl_passwd'] = ''
node.default['postfix']['main']['relayhost'] = ''
node.default_unless['postfix']['sasl_password_file'] = "#{node['postfix']['conf_dir']}/sasl_passwd"
node.default_unless['postfix']['main']['smtp_sasl_password_maps'] = "hash:#{node['postfix']['sasl_password_file']}"
node.default_unless['postfix']['main']['smtp_sasl_security_options'] = 'noanonymous'
node.default_unless['postfix']['sasl']['smtp_sasl_user_name'] = ''
node.default_unless['postfix']['sasl']['smtp_sasl_passwd'] = ''
node.default_unless['postfix']['main']['relayhost'] = ''
end
if node['postfix']['use_alias_maps']
node.default['postfix']['main']['alias_maps'] = ["hash:#{node['postfix']['aliases_db']}"]
node.default_unless['postfix']['main']['alias_maps'] = ["hash:#{node['postfix']['aliases_db']}"]
end
if node['postfix']['use_transport_maps']
node.default['postfix']['main']['transport_maps'] = ["hash:#{node['postfix']['transport_db']}"]
node.default_unless['postfix']['main']['transport_maps'] = ["hash:#{node['postfix']['transport_db']}"]
end
if node['postfix']['use_access_maps']
node.default['postfix']['main']['access_maps'] = ["hash:#{node['postfix']['access_db']}"]
node.default_unless['postfix']['main']['access_maps'] = ["hash:#{node['postfix']['access_db']}"]
end
if node['postfix']['use_virtual_aliases']
node.default['postfix']['main']['virtual_alias_maps'] = ["#{node['postfix']['virtual_alias_db_type']}:#{node['postfix']['virtual_alias_db']}"]
node.default_unless['postfix']['main']['virtual_alias_maps'] = ["#{node['postfix']['virtual_alias_db_type']}:#{node['postfix']['virtual_alias_db']}"]
end
if node['postfix']['use_virtual_aliases_domains']
node.default['postfix']['main']['virtual_alias_domains'] = ["#{node['postfix']['virtual_alias_domains_db_type']}:#{node['postfix']['virtual_alias_domains_db']}"]
node.default_unless['postfix']['main']['virtual_alias_domains'] = ["#{node['postfix']['virtual_alias_domains_db_type']}:#{node['postfix']['virtual_alias_domains_db']}"]
end
if node['postfix']['use_relay_restirictions_maps']
default['postfix']['main']['smtpd_relay_restrictions'] = "hash:#{node['postfix']['relay_restrictions_db']}, reject"
end
if node['postfix']['master']['maildrop']['active']
node.default_unless['postfix']['main']['maildrop_destination_recipient_limit'] = 1
end
if node['postfix']['master']['cyrus']['active']
node.default_unless['postfix']['main']['cyrus_destination_recipient_limit'] = 1
end

View File

@@ -1,9 +1,8 @@
# encoding: utf-8
# Author:: Joshua Timberman(<joshua@chef.io>)
# Cookbook Name:: common
# Cookbook:: common
# Recipe:: default
#
# Copyright 2009-2014, Chef Software, Inc.
# Copyright:: 2009-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -57,7 +56,7 @@ when 'omnios'
# we don't guard this because if the user creation was successful (or happened out of band), then this won't get executed when the action is :nothing.
execute '/opt/omni/sbin/postfix set-permissions'
template manifest_path do
template manifest_path do
source 'manifest-postfix.xml.erb'
owner 'root'
group node['root_group']
@@ -87,7 +86,7 @@ unless node['postfix']['sender_canonical_map_entries'].empty?
end
unless node['postfix']['main'].key?('sender_canonical_maps')
node.set['postfix']['main']['sender_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/sender_canonical"
node.normal['postfix']['main']['sender_canonical_maps'] = "hash:#{node['postfix']['conf_dir']}/sender_canonical"
end
end
@@ -100,13 +99,13 @@ unless node['postfix']['smtp_generic_map_entries'].empty?
template "#{node['postfix']['conf_dir']}/smtp_generic" do
owner 'root'
group node['root_group']
mode '0644'
mode '0644'
notifies :run, 'execute[update-postfix-smtp_generic]'
notifies :reload, 'service[postfix]'
end
unless node['postfix']['main'].key?('smtp_generic_maps')
node.set['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic"
node.normal['postfix']['main']['smtp_generic_maps'] = "hash:#{node['postfix']['conf_dir']}/smtp_generic"
end
end

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2012, Chef Software, Inc.
# Copyright:: 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright 2012-2014, Chef Software, Inc.
# Copyright:: Copyright 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,7 +19,7 @@ execute 'update-postfix-aliases' do
command 'newaliases'
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
# On FreeBSD, /usr/sbin/newaliases is the sendmail command, and it's in the path before postfix's /usr/local/bin/newaliases
environment ({ 'PATH' => "/usr/local/bin:#{ENV['PATH']}" }) if platform_family?('freebsd')
environment('PATH' => "/usr/local/bin:#{ENV['PATH']}") if platform_family?('freebsd')
action :nothing
end

View File

@@ -1,9 +1,8 @@
# encoding: utf-8
# Author:: Joshua Timberman(<joshua@chef.io>)
# Cookbook Name:: postfix
# Cookbook:: postfix
# Recipe:: client
#
# Copyright 2009-2014, Chef Software, Inc.
# Copyright:: 2009-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -37,6 +36,6 @@ else
relayhost = results.map { |n| n['ipaddress'] }.first
end
node.set['postfix']['main']['relayhost'] = "[#{relayhost}]"
node.normal['postfix']['main']['relayhost'] = "[#{relayhost}]"
include_recipe 'postfix'

View File

@@ -1,9 +1,8 @@
# encoding: utf-8
# Author:: Joshua Timberman(<joshua@chef.io>)
# Cookbook Name:: postfix
# Cookbook:: postfix
# Recipe:: default
#
# Copyright 2009-2014, Chef Software, Inc.
# Copyright:: 2009-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -20,31 +19,18 @@
include_recipe 'postfix::_common'
if node['postfix']['main']['smtp_sasl_auth_enable'] == 'yes'
include_recipe 'postfix::sasl_auth'
end
include_recipe 'postfix::sasl_auth' if node['postfix']['main']['smtp_sasl_auth_enable'] == 'yes'
if node['postfix']['use_alias_maps']
include_recipe 'postfix::aliases'
end
include_recipe 'postfix::aliases' if node['postfix']['use_alias_maps']
if node['postfix']['use_transport_maps']
include_recipe 'postfix::transports'
end
include_recipe 'postfix::transports' if node['postfix']['use_transport_maps']
if node['postfix']['use_access_maps']
include_recipe 'postfix::access'
end
include_recipe 'postfix::access' if node['postfix']['use_access_maps']
if node['postfix']['use_virtual_aliases']
include_recipe 'postfix::virtual_aliases'
end
include_recipe 'postfix::virtual_aliases' if node['postfix']['use_virtual_aliases']
if node['postfix']['use_virtual_aliases_domains']
include_recipe 'postfix::virtual_aliases_domains'
end
include_recipe 'postfix::virtual_aliases_domains' if node['postfix']['use_virtual_aliases_domains']
if node['postfix']['use_relay_restrictions_maps']
include_recipe 'postfix::relay_restrictions'
end
include_recipe 'postfix::relay_restrictions' if node['postfix']['use_relay_restrictions_maps']
include_recipe 'postfix::maps' if node['postfix']['maps']

View File

@@ -0,0 +1,47 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2012, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
node['postfix']['maps'].each do |type, maps|
if node['platform_family'] == 'debian'
package "postfix-#{type}" if %w(pgsql mysql ldap cdb).include?(type)
end
separator = if %w(pgsql mysql ldap memcache sqlite).include?(type)
' = '
else
' '
end
maps.each do |file, content|
execute "update-postmap-#{file}" do
command "postmap #{file}"
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
action :nothing
end if %w(btree cdb dbm hash sdbm).include?(type)
template "#{file}-#{type}" do
path file
source 'maps.erb'
only_if "postconf -m | grep -q #{type}"
variables(
map: content,
separator: separator
)
if %w(btree cdb dbm hash sdbm).include?(type)
notifies :run, "execute[update-postmap-#{file}]"
end
notifies :restart, 'service[postfix]'
end
end
end

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2012, Chef Software, Inc.
# Copyright:: 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -26,4 +25,3 @@ template node['postfix']['relay_restrictions_db'] do
source 'relay_restrictions.erb'
notifies :run, 'execute[update-postfix-relay-restrictions]'
end

View File

@@ -1,10 +1,9 @@
# encoding: utf-8
#
# Author:: Joshua Timberman(<joshua@chef.io>)
# Cookbook Name:: postfix
# Cookbook:: postfix
# Recipe:: sasl_auth
#
# Copyright 2009-2014, Chef Software, Inc.
# Copyright:: 2009-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -29,11 +28,11 @@ case node['platform_family']
when 'debian'
sasl_pkgs = %w(libsasl2-2 libsasl2-modules ca-certificates)
when 'rhel'
if node['platform_version'].to_i < 6
sasl_pkgs = %w(cyrus-sasl cyrus-sasl-plain openssl)
else
sasl_pkgs = %w(cyrus-sasl cyrus-sasl-plain ca-certificates)
end
sasl_pkgs = if node['platform_version'].to_i < 6
%w(cyrus-sasl cyrus-sasl-plain openssl)
else
%w(cyrus-sasl cyrus-sasl-plain ca-certificates)
end
when 'fedora'
sasl_pkgs = %w(cyrus-sasl cyrus-sasl-plain ca-certificates)
end
@@ -53,7 +52,7 @@ template node['postfix']['sasl_password_file'] do
source 'sasl_passwd.erb'
owner 'root'
group node['root_group']
mode 0400
mode '400'
notifies :run, 'execute[postmap-sasl_passwd]', :immediately
notifies :restart, 'service[postfix]'
variables(settings: node['postfix']['sasl'])

View File

@@ -1,10 +1,9 @@
# encoding: utf-8
#
# Author:: Joshua Timberman(<joshua@chef.io>)
# Cookbook Name:: postfix
# Cookbook:: postfix
# Recipe:: server
#
# Copyright 2009-2014, Chef Software, Inc.
# Copyright:: 2009-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2012, Chef Software, Inc.
# Copyright:: 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2012, Chef Software, Inc.
# Copyright:: 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -1,5 +1,4 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2012, Chef Software, Inc.
# Copyright:: 2012-2016, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.