Code refactoring to use templates
diff --git a/metadata/service/client/init.yml b/metadata/service/client/init.yml
new file mode 100644
index 0000000..bf1abe2
--- /dev/null
+++ b/metadata/service/client/init.yml
@@ -0,0 +1,4 @@
+parameters:
+  designate:
+    client:
+      enabled: true
diff --git a/metadata/service/server/cluster.yml b/metadata/service/server/cluster.yml
index e2eafbb..f1e9f69 100644
--- a/metadata/service/server/cluster.yml
+++ b/metadata/service/server/cluster.yml
@@ -7,83 +7,32 @@
     server:
       enabled: true
       local_bind: true
-      ################################################################################
-      #########       Designate config (/etc/designate/designate.conf)       #########
-      ################################################################################
-      designate_config:
-        DEFAULT:
-          verbose: 'True'
-          debug: 'False'
-          rabbit_userid: 'stackrabbit'
-          rabbit_password: 'PASSWORD'
-          rabbit_hosts: '127.0.0.1'
-        service:api:
-          api_base_uri: http://127.0.0.1:9001/
-          api_host: 127.0.0.1
-          api_port: '9001'
-          enabled_extensions_v1: diagnostics, quotas, reports, sync, touch
-          enable_api_v2: 'True'
-          enable_api_v1: 'True'
-          enabled_extensions_v2: quotas, reports
-          auth_strategy: keystone
-        service:sink:
-          enabled_notification_handlers: nova_fixed, neutron_floatingip
-        handler:nova_fixed:
-          domain_id: 833e4a34-bddd-45e4-b754-1b7616d95681
-          notification_topics: notifications
-          control_exchange: neutron
-#          format: '%(octet0)s-%(octet1)s-%(octet2)s-%(octet3)s.%(domain)s'
-          format: '%(hostname)s.%(domain)s'
-        keystone_authtoken:
-          auth_host: 127.0.0.1
-          auth_port: '35357'
-          auth_protocol: http
-          admin_tenant_name: admin
-          admin_user: admin
-          admin_password: PASSWORD
-        pool_manager_cache:sqlalchemy:
-          connection: mysql://designate-common:PASSWORD@127.0.0.1/designate_pool_manager
-        storage:sqlalchemy:
-          connection: mysql://designate-common:PASSWORD@127.0.0.1/designatedb
-        service:pool_manager:
-          pool_id: 794ccc2c-d751-44fe-b57f-8894c9f5c842
-        pool:794ccc2c-d751-44fe-b57f-8894c9f5c842:
-          nameservers: 0f66b842-96c2-4189-93fc-1dc95a08b012, a7c98d54-6c08-497e-ae50-c31b44923041, 871df553-07e4-4a21-8b5b-c15439e286b1
-          targets: f26e0b32-736f-4f0a-831b-039a415c481e, 2683d05e-1290-4018-a02b-9a69af847d7c, dab43696-04bf-4162-8fc4-61947815c628
-        pool_target:f26e0b32-736f-4f0a-831b-039a415c481e:
-          masters: 127.0.0.1:5354
-          type: bind9
-          options: 'port: 53, host: 192.168.122.169'
-        pool_target:2683d05e-1290-4018-a02b-9a69af847d7c:
-          masters: 192.168.122.69:5354
-          type: bind9
-          options: 'port: 53, host: 192.168.122.69'
-        pool_target:dab43696-04bf-4162-8fc4-61947815c628:
-          masters: 192.168.122.119:5354
-          type: bind9
-          options: 'port: 53, host: 192.168.122.119'
-        pool_nameserver:0f66b842-96c2-4189-93fc-1dc95a08b012:
-          port: '53'
-          host: 127.0.0.1
-        pool_nameserver:a7c98d54-6c08-497e-ae50-c31b44923041:
-          port: '53'
-          host: 192.168.122.69
-        pool_nameserver:871df553-07e4-4a21-8b5b-c15439e286b1:
-          port: '53'
-          host: 192.168.122.119
-      ################################################################################
+      region: RegionOne
+      domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
+      version: ${_param:designate_version}
+      bind:
+        api:
+          address: ${_param:cluster_local_address}
       database:
         engine: mysql
         host: ${_param:cluster_vip_address}
         port: 3306
-        name: designate
+        name:
+          main_database: designate
+          pool_manager: designate_pool_manager
         user: designate
         password: ${_param:mysql_designate_password}
       identity:
         engine: keystone
-        region: RegionOne
         host: ${_param:cluster_vip_address}
         port: 35357
         tenant: service
         user: designate
         password: ${_param:keystone_designate_password}
+      message_queue:
+        engine: rabbitmq
+        host: ${_param:cluster_vip_address}
+        port: 5672
+        user: openstack
+        password: ${_param:rabbitmq_openstack_password}
+        virtual_host: '/openstack'
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index db774e4..0939d68 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -7,69 +7,32 @@
     server:
       enabled: true
       local_bind: true
-      ################################################################################
-      #########       Designate config (/etc/designate/designate.conf)       #########
-      ################################################################################
-      designate_config:
-        DEFAULT:
-          verbose: 'True'
-          debug: 'False'
-          rabbit_userid: 'stackrabbit'
-          rabbit_password: 'PASSWORD'
-          rabbit_hosts: '127.0.0.1'
-        service:api:
-          api_base_uri: http://127.0.0.1:9001/
-          api_host: 127.0.0.1
-          api_port: '9001'
-          enabled_extensions_v1: diagnostics, quotas, reports, sync, touch
-          enable_api_v2: 'True'
-          enable_api_v1: 'True'
-          enabled_extensions_v2: quotas, reports
-          auth_strategy: keystone
-        service:sink:
-          enabled_notification_handlers: nova_fixed, neutron_floatingip
-        handler:nova_fixed:
-          domain_id: 833e4a34-bddd-45e4-b754-1b7616d95681
-          notification_topics: notifications
-          control_exchange: neutron
-#          format: '%(octet0)s-%(octet1)s-%(octet2)s-%(octet3)s.%(domain)s'
-          format: '%(hostname)s.%(domain)s'
-        keystone_authtoken:
-          auth_host: 127.0.0.1
-          auth_port: '35357'
-          auth_protocol: http
-          admin_tenant_name: admin
-          admin_user: admin
-          admin_password: PASSWORD
-        pool_manager_cache:sqlalchemy:
-          connection: mysql://designate-common:PASSWORD@127.0.0.1/designate_pool_manager
-        storage:sqlalchemy:
-          connection: mysql://designate-common:PASSWORD@127.0.0.1/designatedb
-        service:pool_manager:
-          pool_id: 794ccc2c-d751-44fe-b57f-8894c9f5c842
-        pool:794ccc2c-d751-44fe-b57f-8894c9f5c842:
-          nameservers: 0f66b842-96c2-4189-93fc-1dc95a08b012
-          targets: f26e0b32-736f-4f0a-831b-039a415c481e
-        pool_nameserver:0f66b842-96c2-4189-93fc-1dc95a08b012:
-          port: 53
-          host: 127.0.0.1
-        pool_target:f26e0b32-736f-4f0a-831b-039a415c481e:
-          options: 'port: 53, host: 127.0.0.1'
-          masters: 127.0.0.1:5354
-          type: bind9
-      ################################################################################
+      region: RegionOne
+      domain_id: 5186883b-91fb-4891-bd49-e6769234a8fc
+      version: ${_param:designate_version}
+      bind:
+        api:
+          address: ${_param:single_address}
       database:
         engine: mysql
-        host: ${_param:cluster_vip_address}
+        host: ${_param:single_address}
         port: 3306
-        name: designate
+        name:
+          main_database: designate
+          pool_manager: designate_pool_manager
         user: designate
         password: ${_param:mysql_designate_password}
       identity:
         engine: keystone
-        region: RegionOne
-        host: ${_param:cluster_vip_address}
+        host: ${_param:single_address}
         port: 35357
         tenant: service
         user: designate
         password: ${_param:keystone_designate_password}
+      message_queue:
+        engine: rabbitmq
+        host: ${_param:single_address}
+        port: 5672
+        user: openstack
+        password: ${_param:rabbitmq_openstack_password}
+        virtual_host: '/openstack'
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 01a81ff..3241a5c 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -4,7 +4,7 @@
       collectd:
         enabled: false
       heka:
-        enabled: true
+        enabled: false
       sensu:
         enabled: true
       sphinx: