Merge pull request #41 from FHE3/partition-handling

Fix for issue #39. Cluster setting cluster_partition_handling can now…
diff --git a/rabbitmq/files/rabbitmq.config b/rabbitmq/files/rabbitmq.config
index 5f1352a..4cef5ca 100644
--- a/rabbitmq/files/rabbitmq.config
+++ b/rabbitmq/files/rabbitmq.config
@@ -5,7 +5,7 @@
               {disk_free_limit, {{ server.disk_free_limit }}},
               {%- if pillar.rabbitmq.cluster is defined %}
               {%- from "rabbitmq/map.jinja" import cluster with context %}
-              {cluster_partition_handling, autoheal},
+              {cluster_partition_handling, {{ cluster.partition_handling }}},
               {tcp_listen_options,
                         [binary,
                           {packet, raw},
diff --git a/rabbitmq/map.jinja b/rabbitmq/map.jinja
index ea508c0..f169d0b 100644
--- a/rabbitmq/map.jinja
+++ b/rabbitmq/map.jinja
@@ -44,8 +44,11 @@
     },
 }, merge=pillar.rabbitmq.get('server', {}), base='default') %}
 
-{% set cluster = pillar.rabbitmq.get('cluster', {}) %}
-
+{% set cluster = salt['grains.filter_by']({
+  'default': {
+    'partition_handling': 'autoheal',
+  },
+}, merge=salt['pillar.get']('rabbitmq:cluster'), base='default') %}
 {%- set rabbitmq_users = {} %}
 {%- for host_name, host in server.get('host', {}).iteritems() %}
 {%- do rabbitmq_users.update({host.user: [host]}) %}