Open sellerthorpe opened 8 years ago
I have recently updated the templates I started to properly hash these variables. I am still a bit new to this, so while my original templates work, they were not written as proper hashes.
In server.pp ... $canonical_data = {}, $generic_data = {}, ...
And in the templates, I replaced the 3 lines from before with this: --> <%- generic_data.keys.sort_by { |sk| (sk.to_s.upcase) }.each do |k| -%> <%- v = generic_data[k] -%> <%- if v != :undef and v != '' -%> <%= k %> <%= v %> <%- end -%> <%- end -%>
--> <%- canonical_data.keys.sort_by { |sk| (sk.to_s.upcase) }.each do |k| -%> <%- v = canonical_data[k] -%> <%- if v != :undef and v != '' -%> <%= k %> <%= v %> <%- end -%> <%- end -%>
Thank you again for this excellent module!
Good morning!
I love the module, and it has worked very well for me with a couple slight modification for my environment. I wanted to contribute to the project by letting you know what I tweaked, and seeing if this falls in line with what you've done. Hopefully you would like to add these changes to a future release, as it could help others who have a similar need.
--> <% @canonical_data.sort.each do |line| -%> <%= line %> <% end -%>
So as you can see, it should fall in line with what is already created. This just allows central configuration of the map data, as opposed to manually creating them on each server. In my environment this is required as none of my servers are routeable through to our corporate mail, and DNS is not resolvable. We use maps to mask our sender to a proper address before it hits a relay.
I hope this helps others out! Thank you for creating this.