[COOK-3116] Add SmartOS support
Signed-off-by: Seth Vargo <sethvargo@gmail.com>
This commit is contained in:
parent
330f140c71
commit
a1f685680c
@ -52,4 +52,7 @@ suites:
|
|||||||
- name: sasl_auth
|
- name: sasl_auth
|
||||||
run_list:
|
run_list:
|
||||||
- recipe[postfix::sasl_auth]
|
- recipe[postfix::sasl_auth]
|
||||||
attributes: {}
|
attributes:
|
||||||
|
postfix:
|
||||||
|
main :
|
||||||
|
smtp_sasl_auth_enable: "yes"
|
||||||
|
@ -24,16 +24,25 @@ default['postfix']['aliases'] = {}
|
|||||||
default['postfix']['main_template_source'] = "postfix"
|
default['postfix']['main_template_source'] = "postfix"
|
||||||
default['postfix']['master_template_source'] = "postfix"
|
default['postfix']['master_template_source'] = "postfix"
|
||||||
|
|
||||||
|
case node['platform']
|
||||||
|
when 'smartos'
|
||||||
|
default['postfix']['conf_dir'] = '/opt/local/etc/postfix'
|
||||||
|
default['postfix']['aliases_db'] = '/opt/local/etc/postfix/aliases'
|
||||||
|
else
|
||||||
|
default['postfix']['conf_dir'] = '/etc/postfix'
|
||||||
|
default['postfix']['aliases_db'] = '/etc/aliases'
|
||||||
|
end
|
||||||
|
|
||||||
# Non-default main.cf attributes
|
# Non-default main.cf attributes
|
||||||
default['postfix']['main']['biff'] = "no"
|
default['postfix']['main']['biff'] = "no"
|
||||||
default['postfix']['main']['append_dot_mydomain'] = "no"
|
default['postfix']['main']['append_dot_mydomain'] = "no"
|
||||||
default['postfix']['main']['myhostname'] = node['fqdn']
|
default['postfix']['main']['myhostname'] = node['fqdn'].chomp('.') || node['hostname'].chomp('.')
|
||||||
default['postfix']['main']['mydomain'] = node['domain']
|
default['postfix']['main']['mydomain'] = node['domain'].chomp('.') || node['hostname'].chomp('.')
|
||||||
default['postfix']['main']['myorigin'] = "$myhostname"
|
default['postfix']['main']['myorigin'] = "$myhostname"
|
||||||
default['postfix']['main']['mydestination'] = [ node['postfix']['main']['myhostname'], node['hostname'], "localhost.localdomain", "localhost" ]
|
default['postfix']['main']['mydestination'] = [ node['postfix']['main']['myhostname'], node['hostname'], "localhost.localdomain", "localhost" ].compact
|
||||||
default['postfix']['main']['smtpd_use_tls'] = "yes"
|
default['postfix']['main']['smtpd_use_tls'] = "yes"
|
||||||
default['postfix']['main']['smtp_use_tls'] = "yes"
|
default['postfix']['main']['smtp_use_tls'] = "yes"
|
||||||
default['postfix']['main']['alias_maps'] = [ "hash:/etc/aliases" ]
|
default['postfix']['main']['alias_maps'] = [ "hash:#{node['postfix']['aliases_db']}" ]
|
||||||
default['postfix']['main']['mailbox_size_limit'] = 0
|
default['postfix']['main']['mailbox_size_limit'] = 0
|
||||||
default['postfix']['main']['recipient_delimiter'] = "+"
|
default['postfix']['main']['recipient_delimiter'] = "+"
|
||||||
default['postfix']['main']['smtp_sasl_auth_enable'] = "no"
|
default['postfix']['main']['smtp_sasl_auth_enable'] = "no"
|
||||||
@ -41,7 +50,11 @@ default['postfix']['main']['mynetworks'] = "127.0.0.0/8"
|
|||||||
default['postfix']['main']['inet_interfaces'] = "loopback-only"
|
default['postfix']['main']['inet_interfaces'] = "loopback-only"
|
||||||
|
|
||||||
# Conditional attributes
|
# Conditional attributes
|
||||||
case node['platform_family']
|
case node['platform']
|
||||||
|
when 'smartos'
|
||||||
|
default['postfix']['main']['smtpd_use_tls'] = "no"
|
||||||
|
default['postfix']['main']['smtp_use_tls'] = "no"
|
||||||
|
cafile = "/opt/local/etc/postfix/cacert.pem"
|
||||||
when "rhel"
|
when "rhel"
|
||||||
cafile = "/etc/pki/tls/cert.pem"
|
cafile = "/etc/pki/tls/cert.pem"
|
||||||
else
|
else
|
||||||
@ -65,7 +78,7 @@ if node['postfix']['main']['smtp_use_tls'] == "yes"
|
|||||||
end
|
end
|
||||||
|
|
||||||
if node['postfix']['main']['smtp_sasl_auth_enable'] == "yes"
|
if node['postfix']['main']['smtp_sasl_auth_enable'] == "yes"
|
||||||
default['postfix']['main']['smtp_sasl_password_maps'] = "hash:/etc/postfix/sasl_passwd"
|
default['postfix']['main']['smtp_sasl_password_maps'] = "hash:#{node['postfix']['conf_dir']}/postfix/sasl_passwd"
|
||||||
default['postfix']['main']['smtp_sasl_security_options'] = "noanonymous"
|
default['postfix']['main']['smtp_sasl_security_options'] = "noanonymous"
|
||||||
default['postfix']['sasl']['smtp_sasl_user_name'] = ""
|
default['postfix']['sasl']['smtp_sasl_user_name'] = ""
|
||||||
default['postfix']['sasl']['smtp_sasl_passwd'] = ""
|
default['postfix']['sasl']['smtp_sasl_passwd'] = ""
|
||||||
|
@ -10,7 +10,7 @@ recipe "postfix::aliases", "Manages /etc/aliases"
|
|||||||
recipe "postfix::client", "Searches for the relayhost based on an attribute"
|
recipe "postfix::client", "Searches for the relayhost based on an attribute"
|
||||||
recipe "postfix::server", "Sets the mail_type attribute to master"
|
recipe "postfix::server", "Sets the mail_type attribute to master"
|
||||||
|
|
||||||
%w{ubuntu debian redhat centos amazon scientific}.each do |os|
|
%w{ubuntu debian redhat centos amazon scientific smartos}.each do |os|
|
||||||
supports os
|
supports os
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ execute "update-postfix-aliases" do
|
|||||||
action :nothing
|
action :nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
template "/etc/aliases" do
|
template node['postfix']['aliases_db'] do
|
||||||
source "aliases.erb"
|
source "aliases.erb"
|
||||||
notifies :run, "execute[update-postfix-aliases]"
|
notifies :run, "execute[update-postfix-aliases]"
|
||||||
end
|
end
|
||||||
|
@ -44,7 +44,7 @@ when "rhel", "fedora"
|
|||||||
end
|
end
|
||||||
|
|
||||||
%w{main master}.each do |cfg|
|
%w{main master}.each do |cfg|
|
||||||
template "/etc/postfix/#{cfg}.cf" do
|
template "#{node['postfix']['conf_dir']}/#{cfg}.cf" do
|
||||||
source "#{cfg}.cf.erb"
|
source "#{cfg}.cf.erb"
|
||||||
owner "root"
|
owner "root"
|
||||||
group 0
|
group 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user