Use attribute for root dir
This commit is contained in:
parent
98acd429de
commit
daadd9374f
@ -5,11 +5,23 @@
|
|||||||
|
|
||||||
domain = node["email"]["domain"]
|
domain = node["email"]["domain"]
|
||||||
hostname = node["email"]["hostname"]
|
hostname = node["email"]["hostname"]
|
||||||
|
root_dir = node["email"]["root_directory"]
|
||||||
ip_addr = node["knife_zero"]["host"]
|
ip_addr = node["knife_zero"]["host"]
|
||||||
|
|
||||||
node.override["set_fqdn"] = hostname
|
node.override["set_fqdn"] = hostname
|
||||||
include_recipe "hostname"
|
include_recipe "hostname"
|
||||||
|
|
||||||
|
user "vmail" do
|
||||||
|
gid "mail"
|
||||||
|
system true
|
||||||
|
manage_home false
|
||||||
|
end
|
||||||
|
|
||||||
|
directory root_dir do
|
||||||
|
owner "vmail"
|
||||||
|
group "mail"
|
||||||
|
end
|
||||||
|
|
||||||
tls_cert_for hostname do
|
tls_cert_for hostname do
|
||||||
auth "gandi_dns"
|
auth "gandi_dns"
|
||||||
action :create
|
action :create
|
||||||
|
@ -15,6 +15,7 @@ end
|
|||||||
|
|
||||||
domain = node["email"]["domain"]
|
domain = node["email"]["domain"]
|
||||||
hostname = node["email"]["hostname"]
|
hostname = node["email"]["hostname"]
|
||||||
|
root_dir = node["email"]["root_directory"]
|
||||||
ip_addr = node["knife_zero"]["host"]
|
ip_addr = node["knife_zero"]["host"]
|
||||||
|
|
||||||
ldap_search_base = node["email"]["ldap_search_base"]
|
ldap_search_base = node["email"]["ldap_search_base"]
|
||||||
@ -22,17 +23,6 @@ ldap_user_filter = "(&(objectClass=person)(mailRoutingAddress=%u))"
|
|||||||
|
|
||||||
credentials = Chef::EncryptedDataBagItem.load('credentials', 'email')
|
credentials = Chef::EncryptedDataBagItem.load('credentials', 'email')
|
||||||
|
|
||||||
user "vmail" do
|
|
||||||
gid "mail"
|
|
||||||
system true
|
|
||||||
manage_home false
|
|
||||||
end
|
|
||||||
|
|
||||||
directory "/var/vmail" do
|
|
||||||
owner "vmail"
|
|
||||||
group "mail"
|
|
||||||
end
|
|
||||||
|
|
||||||
template "/etc/dovecot/dovecot.conf" do
|
template "/etc/dovecot/dovecot.conf" do
|
||||||
source "dovecot.conf.erb"
|
source "dovecot.conf.erb"
|
||||||
mode 0644
|
mode 0644
|
||||||
@ -70,7 +60,7 @@ template "/etc/dovecot/conf.d/10-mail.conf" do
|
|||||||
variables mail_uid: "vmail",
|
variables mail_uid: "vmail",
|
||||||
mail_gid: "mail",
|
mail_gid: "mail",
|
||||||
mail_location: "mbox:~/mail:INBOX=~/mail/INBOX",
|
mail_location: "mbox:~/mail:INBOX=~/mail/INBOX",
|
||||||
mail_home: "/var/vmail/%d/%n"
|
mail_home: "#{root_dir}/%d/%n"
|
||||||
notifies :restart, "service[dovecot]", :delayed
|
notifies :restart, "service[dovecot]", :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user