add support for config generation

Change-Id: Ica87f6f3a3f1aa4e710c4d13d37ade321e40a0ac
diff --git a/cinder/map.jinja b/cinder/map.jinja
index 39bcb2e..e1c6ded 100644
--- a/cinder/map.jinja
+++ b/cinder/map.jinja
@@ -12,7 +12,7 @@
         'wipe_method': 'none',
         'notification': False,
     },
-}, merge=salt['pillar.get']('cinder:controller')) %}
+}, merge=pillar.cinder.get('controller', {})) %}
 
 {% set volume = salt['grains.filter_by']({
     'Debian': {
@@ -27,4 +27,4 @@
         'wipe_method': 'none',
         'notification': False,
     },
-}, merge=salt['pillar.get']('cinder:volume')) %}
+}, merge=pillar.cinder.get('volume', {})) %}
diff --git a/cinder/meta/config.yml b/cinder/meta/config.yml
new file mode 100644
index 0000000..e9ccfdf
--- /dev/null
+++ b/cinder/meta/config.yml
@@ -0,0 +1,10 @@
+config:
+  {%- if pillar.cinder.controller is defined %}
+  {%- from "cinder/map.jinja" import controller with context %}
+  cinder.conf:
+    source: "salt://cinder/files/{{ controller.version }}/cinder.conf.controller.{{ grains.os_family|default('Debian') }}"
+    template: jinja
+  api-paste.ini:
+    source: "salt://cinder/files/{{ controller.version }}/api-paste.ini.controller.{{ grains.os_family|default('Debian') }}"
+    template: jinja
+  {%- endif %}
\ No newline at end of file
diff --git a/metadata/service/control/container.yml b/metadata/service/control/container.yml
new file mode 100644
index 0000000..951ded8
--- /dev/null
+++ b/metadata/service/control/container.yml
@@ -0,0 +1,41 @@
+parameters:
+  kubernetes:
+    control:
+      configmap:
+        cinder-control:
+          grains:
+            os_family: Debian
+          pillar:
+            cinder:
+              controller:
+                enabled: true
+                version: ${_param:cinder_version}
+                default_volume_type: ""
+                backend: {}
+                osapi:
+                  host: 0.0.0.0
+                database:
+                  engine: mysql
+                  host: ${_param:mysql_service_host}
+                  port: 3306
+                  name: cinder
+                  user: cinder
+                  password: ${_param:mysql_cinder_password}
+                identity:
+                  engine: keystone
+                  region: RegionOne
+                  host: ${_param:keystone_service_host}
+                  port: 35357
+                  tenant: service
+                  user: cinder
+                  password: ${_param:keystone_cinder_password}
+                glance:
+                  host: ${_param:glance_service_host}
+                  port: 9292
+                message_queue:
+                  engine: rabbitmq
+                  user: openstack
+                  password: ${_param:rabbitmq_openstack_password}
+                  virtual_host: '/openstack'
+                cache:
+                  engine: memcached
\ No newline at end of file
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index bb1eadc..a9f6861 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -9,3 +9,5 @@
         enabled: true
       sphinx:
         enabled: true
+      config:
+        enabled: true
\ No newline at end of file