]> git.openstreetmap.org Git - chef.git/commitdiff
Setup mail handling for crm.osmfoundation.org
authorTom Hughes <tom@compton.nu>
Mon, 24 Mar 2014 19:20:36 +0000 (19:20 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 24 Mar 2014 20:05:36 +0000 (20:05 +0000)
cookbooks/exim/templates/default/exim4.conf.erb
roles/crm.rb [new file with mode: 0644]
roles/foundation.rb
roles/mail.rb

index 3b33facf7fd5941edc1562b8d2f2f191b72dd018..52816e7fa5b79fe32f748df78b03b9424271f1d4 100644 (file)
@@ -697,19 +697,31 @@ noreply:
   group = Debian-exim
 
 <% node[:exim][:routes].each do |name,details| -%>
-<% if details[:command] -%>
+<% if details[:command] or details[:file] or details[:maildir] -%>
 # This transport handles mail for <%= details[:comment] -%>.
 
 <%= name -%>:
+<% if details[:command] -%>
   driver = pipe
   command = <%= details[:command] %>
+  home_directory = <%= details[:home_directory] %>
+  return_output
+<% else -%>
+  driver = appendfile
+<% if details[:file] -%>
+  file = <%= details[:file] %>
+<% elsif details[:maildir] -%>
+  directory = <%= details[:maildir] %>
+  maildir_format
+<% end -%>
+  envelope_to_add
+  return_path_add
+  mode = 0660
+<% end -%>
   user = <%= details[:user] %>
 <% if details[:group] -%>
   group = <%= details[:group] %>
 <% end -%>
-  home_directory = <%= details[:home_directory] %>
-  return_output
-
 
 <% end -%>
 <% end -%>
diff --git a/roles/crm.rb b/roles/crm.rb
new file mode 100644 (file)
index 0000000..35776f0
--- /dev/null
@@ -0,0 +1,22 @@
+name "crm"
+description "Role applied to CRM server"
+
+
+default_attributes(
+  :exim => {
+    :local_domains => [ "crm.osmfoundation.org" ],
+    :routes => {
+      :crm => {
+        :comment => "crm.osmfoundation.org",
+        :domains => [ "crm.osmfoundation.org" ],
+        :maildir => "/var/mail/crm",
+        :user => "wordpress",
+        :group => "mail"
+      }
+    }
+  }
+)
+
+run_list(
+  "recipe[civicrm]"
+)
index b6a324772ada25f972634d4eab2c0cf53f586f8d..e02b7d3e2631644ade1680e3496b5efa03041197 100644 (file)
@@ -18,5 +18,5 @@ default_attributes(
 )
 
 run_list(
-  "recipe[civicrm]"
+  "role[crm]"
 )
index 68b465595744418c41fefe3df30678316e32a397..5cdb8372fedeb86fcf75393c9558c282987cc46b 100644 (file)
@@ -23,6 +23,11 @@ default_attributes(
         :comment => "tickets.openstreetmap.org",
         :domains => [ "tickets.openstreetmap.org" ],
         :host => "ridley.ucl.openstreetmap.org"
+      },
+      :crm => {
+        :comment => "crm.osmfoundation.org",
+        :domains => [ "crm.osmfoundation.org" ],
+        :host => "ridley.ucl.openstreetmap.org"
       }
     },
     :aliases => {