Merge "Add rabbitmq policies for OpenStack services"
diff --git a/rabbitmq/server/vhost/openstack/ha_for_all_queues.yml b/rabbitmq/server/vhost/openstack/ha_for_all_queues.yml
new file mode 100644
index 0000000..040a8ed
--- /dev/null
+++ b/rabbitmq/server/vhost/openstack/ha_for_all_queues.yml
@@ -0,0 +1,10 @@
+parameters:
+  rabbitmq:
+    server:
+      host:
+        '/openstack':
+          policies:
+          - name: ha-all
+            pattern: '.'
+            definition: '{"ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 0
diff --git a/rabbitmq/server/vhost/openstack/ha_for_all_queues_except_telemetry.yml b/rabbitmq/server/vhost/openstack/ha_for_all_queues_except_telemetry.yml
new file mode 100644
index 0000000..a2eef5b
--- /dev/null
+++ b/rabbitmq/server/vhost/openstack/ha_for_all_queues_except_telemetry.yml
@@ -0,0 +1,10 @@
+parameters:
+  rabbitmq:
+    server:
+      host:
+        '/openstack':
+          policies:
+          - name: ha-all-except-notif
+            pattern: '^((?!(alarm|alarming|event|metering|notifications)\.).)*$'
+            definition: '{"ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 0
diff --git a/rabbitmq/server/vhost/openstack/ha_for_telemetry_queues.yml b/rabbitmq/server/vhost/openstack/ha_for_telemetry_queues.yml
new file mode 100644
index 0000000..d456072
--- /dev/null
+++ b/rabbitmq/server/vhost/openstack/ha_for_telemetry_queues.yml
@@ -0,0 +1,10 @@
+parameters:
+  rabbitmq:
+    server:
+      host:
+        '/openstack':
+          policies:
+          - name: ha-notif
+            pattern: '^(alarm|alarming|event|metering|notifications)\.'
+            definition: '{"ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 0
diff --git a/rabbitmq/server/vhost/openstack/rpc_ha.yml b/rabbitmq/server/vhost/openstack/rpc_ha.yml
new file mode 100644
index 0000000..a3c461d
--- /dev/null
+++ b/rabbitmq/server/vhost/openstack/rpc_ha.yml
@@ -0,0 +1,22 @@
+parameters:
+  rabbitmq:
+    server:
+      host:
+        '/openstack':
+          policies:
+          - name: heat_engine_rpc_expire
+            pattern: '^heat-engine-listener\.'
+            definition: '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 1
+          - name: heat_worker_rpc_expire
+            pattern: '^engine_worker\.'
+            definition: '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 1
+          - name: results_expire
+            pattern: '^results\.'
+            definition: '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 1
+          - name: tasks_expire
+            pattern: '^tasks\.'
+            definition: '{"expires":3600000, "ha-mode":"all", "ha-sync-mode":"automatic"}'
+            priority: 1
diff --git a/rabbitmq/server/vhost/openstack/without_rpc_ha.yml b/rabbitmq/server/vhost/openstack/without_rpc_ha.yml
new file mode 100644
index 0000000..4b35c32
--- /dev/null
+++ b/rabbitmq/server/vhost/openstack/without_rpc_ha.yml
@@ -0,0 +1,22 @@
+parameters:
+  rabbitmq:
+    server:
+      host:
+        '/openstack':
+          policies:
+          - name: heat_engine_rpc_expire
+            pattern: '^heat-engine-listener\.'
+            definition: '{"expires":3600000}'
+            priority: 1
+          - name: heat_worker_rpc_expire
+            pattern: '^engine_worker\.'
+            definition: '{"expires":3600000}'
+            priority: 1
+          - name: results_expire
+            pattern: '^results\.'
+            definition: '{"expires":3600000}'
+            priority: 1
+          - name: tasks_expire
+            pattern: '^tasks\.'
+            definition: '{"expires":3600000}'
+            priority: 1