Skip to content
Browse files

Allow alias value to be an array. COOK-1660

  • Loading branch information...
1 parent b6b9272 commit cc424eff028b4703c499567f1e9a4f54120eac5d @tigris tigris committed with jtimberman
Showing with 4 additions and 1 deletion.
  1. +3 −0 README.md
  2. +1 −1 templates/default/aliases.erb
View
3 README.md
@@ -123,6 +123,9 @@ template to the `templates/default` or to the appropriate
platform+version directory per the File Specificity rules for
templates. Then specify a hash of aliases for the
`node['postfix']['aliases']` attribute.
+Arrays are supported as alias values, since postfix supports
+comma separated values per alias, simply specify your alias
+as an array to use this handy feature.
http://wiki.opscode.com/display/chef/Templates#Templates-TemplateLocationSpecificity
View
2 templates/default/aliases.erb
@@ -7,5 +7,5 @@
postmaster: root
<% node['postfix']['aliases'].each do |name, value| %>
-<%= name %>: "<%= value %>"
+<%= name %>: <%= [value].flatten.map{|x| %Q("#{x}")}.join(', ') %>
<% end unless node['postfix']['aliases'].nil? %>

0 comments on commit cc424ef

Please sign in to comment.
Something went wrong with that request. Please try again.