Permalink
Browse files

COOK-733: added postfix::aliases recipe to manage /etc/aliases

Signed-off-by: jtimberman <joshua@opscode.com>
  • Loading branch information...
1 parent e5b8679 commit 2892a51af739fc4e2f6ae4c6cb05ef3b222a8d25 @apsoto apsoto committed with jtimberman Sep 1, 2011
Showing with 25 additions and 0 deletions.
  1. +5 −0 metadata.rb
  2. +13 −0 recipes/aliases.rb
  3. +7 −0 templates/ubuntu-10.04/aliases.erb
View
@@ -15,6 +15,11 @@
:description => "Hash of Postfix attributes",
:type => "hash"
+attribute "postfix/aliases",
+ :display_name => "Postfix Aliases",
+ :description => "Hash of Postfix aliases mapping a name to a value. Example 'root' => 'operator@example.com'. See aliases man page for details.",
+ :type => "hash"
+
attribute "postfix/mail_type",
:display_name => "Postfix Mail Type",
:description => "Is this node a client or server?",
View
@@ -0,0 +1,13 @@
+require_recipe "postfix"
+
+execute "update-postfix-aliases" do
+ command "newaliases"
+ action :nothing
+end
+
+template "/etc/aliases" do
+ source "aliases.erb"
+ notifies :run, resources("execute[update-postfix-aliases]")
+ #notifies :reload, resources(:service => "postfix")
+end
+
@@ -0,0 +1,7 @@
+# See man 5 aliases for format
+postmaster: root
+
+<% @node[:postfix][:aliases].each do |name, value| %>
+<%= name %>: "<%= value %>"
+<% end unless @node[:postfix][:aliases].nil? %>
+

0 comments on commit 2892a51

Please sign in to comment.