Allow some mail aliases to be placed in a data bag
authorTom Hughes <tom@compton.nu>
Sun, 6 Oct 2013 17:50:58 +0000 (18:50 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 6 Oct 2013 17:50:58 +0000 (18:50 +0100)
cookbooks/exim/recipes/default.rb

index 7c9dc68..b5b1508 100644 (file)
@@ -72,6 +72,14 @@ search(:accounts, "*:*").each do |account|
   end
 end
 
+if node[:exim][:private_aliases]
+  aliases = data_bag_item("exim", "aliases")
+
+  aliases[node[:exim][:private_aliases]].each do |name,address|
+    node.default[:exim][:aliases][name] = address
+  end
+end
+
 template "/etc/aliases" do
   source "aliases.erb"
   owner "root"