Merge "Salt master support"
diff --git a/other-requirements.txt b/bindep.txt
similarity index 100%
rename from other-requirements.txt
rename to bindep.txt
diff --git a/heat/files/juno/heat.conf.Debian b/heat/files/juno/heat.conf.Debian
index 1f4a37f..ccb1503 100644
--- a/heat/files/juno/heat.conf.Debian
+++ b/heat/files/juno/heat.conf.Debian
@@ -27,7 +27,9 @@
 #instance_driver=heat.engine.nova
 
 # List of directories to search for plug-ins. (list value)
-#plugin_dirs=/usr/lib64/heat,/usr/lib/heat
+{%- if server.get('dir', {}).plugins is defined %}
+plugin_dirs={{ server.dir.plugins|join(",") }}
+{%- endif %}
 
 # The directory to search for environment files. (string
 # value)
diff --git a/heat/files/kilo/heat.conf.Debian b/heat/files/kilo/heat.conf.Debian
index 75209d2..1b6ba83 100644
--- a/heat/files/kilo/heat.conf.Debian
+++ b/heat/files/kilo/heat.conf.Debian
@@ -27,6 +27,12 @@
 # Please use logging_context_format_string and logging_default_format_string
 # instead. (string value)
 #log_format = <None>
+
+# List of directories to search for plug-ins. (list value)
+{%- if server.get('dir', {}).plugins is defined %}
+plugin_dirs={{ server.dir.plugins|join(",") }}
+{%- endif %}
+
 heat_metadata_server_url=http://{{ server.metadata.host }}:{{ server.metadata.port }}
 
 # URL of the Heat waitcondition server. (string value)
diff --git a/heat/files/liberty/heat.conf.Debian b/heat/files/liberty/heat.conf.Debian
index 06c535c..3454950 100644
--- a/heat/files/liberty/heat.conf.Debian
+++ b/heat/files/liberty/heat.conf.Debian
@@ -27,6 +27,12 @@
 # Please use logging_context_format_string and logging_default_format_string
 # instead. (string value)
 #log_format = <None>
+
+# List of directories to search for plug-ins. (list value)
+{%- if server.get('dir', {}).plugins is defined %}
+plugin_dirs={{ server.dir.plugins|join(",") }}
+{%- endif %}
+
 heat_metadata_server_url=http://{{ server.metadata.host }}:{{ server.metadata.port }}
 
 # URL of the Heat waitcondition server. (string value)
diff --git a/heat/files/mitaka/heat.conf.Debian b/heat/files/mitaka/heat.conf.Debian
index 0c31202..8b40a90 100644
--- a/heat/files/mitaka/heat.conf.Debian
+++ b/heat/files/mitaka/heat.conf.Debian
@@ -27,6 +27,12 @@
 # Please use logging_context_format_string and logging_default_format_string
 # instead. (string value)
 #log_format = <None>
+
+# List of directories to search for plug-ins. (list value)
+{%- if server.get('dir', {}).plugins is defined %}
+plugin_dirs={{ server.dir.plugins|join(",") }}
+{%- endif %}
+
 heat_metadata_server_url=http://{{ server.metadata.host }}:{{ server.metadata.port }}
 
 # URL of the Heat waitcondition server. (string value)
diff --git a/heat/files/mitaka/heat.conf.RedHat b/heat/files/mitaka/heat.conf.RedHat
index 2d55c92..7f2a7ad 100644
--- a/heat/files/mitaka/heat.conf.RedHat
+++ b/heat/files/mitaka/heat.conf.RedHat
@@ -27,6 +27,12 @@
 # Please use logging_context_format_string and logging_default_format_string
 # instead. (string value)
 #log_format = <None>
+
+# List of directories to search for plug-ins. (list value)
+{%- if server.get('dir', {}).plugins is defined %}
+plugin_dirs={{ server.dir.plugins|join(",") }}
+{%- endif %}
+
 heat_metadata_server_url=http://{{ server.metadata.host }}:{{ server.metadata.port }}
 
 # URL of the Heat waitcondition server. (string value)
diff --git a/heat/map.jinja b/heat/map.jinja
index 4283d0d..e62918c 100644
--- a/heat/map.jinja
+++ b/heat/map.jinja
@@ -10,7 +10,7 @@
         'services': ['openstack-heat-api', 'openstack-heat-api-cfn', 'openstack-heat-api-cloudwatch', 'openstack-heat-engine'],
         'notification': False
     },
-}, merge=salt['pillar.get']('heat:server')) %}
+}, merge=pillar.heat.get('server', {})) %}
 
 {% set client = salt['grains.filter_by']({
     'Debian': {
@@ -19,4 +19,4 @@
     'RedHat': {
         'pkgs': ['python-heatclient'],
     },
-}, merge=salt['pillar.get']('heat:client')) %}
+}, merge=pillar.heat.get('client', {})) %}
diff --git a/heat/meta/config.yml b/heat/meta/config.yml
new file mode 100644
index 0000000..395129f
--- /dev/null
+++ b/heat/meta/config.yml
@@ -0,0 +1,10 @@
+config:
+  {%- if pillar.heat.server is defined %}
+  {%- from "heat/map.jinja" import server with context %}
+  heat.conf:
+    source: "salt://heat/files/{{ server.version }}/heat.conf.{{ grains.os_family|default('Debian') }}"
+    template: jinja
+  api-paste.ini:
+    source: "salt://heat/files/{{ server.version }}/api-paste.ini"
+    template: jinja
+  {%- endif %}
\ No newline at end of file
diff --git a/heat/meta/sensu.yml b/heat/meta/sensu.yml
index 80712a9..e60becf 100644
--- a/heat/meta/sensu.yml
+++ b/heat/meta/sensu.yml
@@ -5,13 +5,13 @@
     occurrences: 1
     subscribers:
     - local-heat-server
-  local_heat_engine:
-    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C heat-engine -u heat -c 1:20"
+  local_heat_engine_proc:
+    command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C heat-engine -u heat -c 1:1024"
     interval: 60
     occurrences: 1
     subscribers:
     - local-heat-server
-  local_heat_api:
+  local_heat_api_proc:
     command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_procs -C heat-api -u heat -c 1:10"
     interval: 60
     occurrences: 1
diff --git a/heat/server.sls b/heat/server.sls
index 92410cb..f9622d0 100644
--- a/heat/server.sls
+++ b/heat/server.sls
@@ -44,6 +44,10 @@
   - names:
     - heat_stack_owner
     - heat_stack_user
+  - connection_user: {{ server.identity.user }}
+  - connection_password: {{ server.identity.password }}
+  - connection_tenant: {{ server.identity.tenant }}
+  - connection_auth_url: 'http://{{ server.identity.host }}:{{ server.identity.port }}/v2.0/'
   - require:
     - pkg: heat_server_packages
 
diff --git a/metadata/service/server/container.yml b/metadata/service/server/container.yml
new file mode 100644
index 0000000..822d900
--- /dev/null
+++ b/metadata/service/server/container.yml
@@ -0,0 +1,54 @@
+parameters:
+  kubernetes:
+    control:
+      configmap:
+        heat-server:
+          grains:
+            os_family: Debian
+          pillar:
+            heat:
+              server:
+                stack_domain_admin:
+                  name: heat_domain_admin
+                  password: ${_param:heat_domain_admin_password}
+                  domain: heat
+                enabled: true
+                region: RegionOne
+                version: ${_param:heat_version}
+                bind:
+                  api_cfn:
+                    address: 0.0.0.0
+                  api_cloudwatch:
+                    address: 0.0.0.0
+                  api:
+                    address: 0.0.0.0
+                database:
+                  engine: mysql
+                  host: ${_param:mysql_service_host}
+                  port: 3306
+                  name: heat
+                  user: heat
+                  password: ${_param:mysql_heat_password}
+                metadata:
+                  host: 0.0.0.0
+                  port: 8000
+                waitcondition:
+                  host: 0.0.0.0
+                  port: 8000
+                watch:
+                  host: 0.0.0.0
+                  port: 8003
+                identity:
+                  engine: keystone
+                  host: ${_param:keystone_service_host}
+                  port: 35357
+                  tenant: service
+                  user: heat
+                  password: ${_param:keystone_heat_password}
+                message_queue:
+                  engine: rabbitmq
+                  host: ${_param:rabbitmq_service_host}
+                  port: 5672
+                  user: openstack
+                  password: ${_param:rabbitmq_openstack_password}
+                  virtual_host: '/openstack'
\ No newline at end of file
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 994f93f..21026d5 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
diff --git a/tests/pillar/server_plugin_dirs.sls b/tests/pillar/server_plugin_dirs.sls
new file mode 100644
index 0000000..2ece784
--- /dev/null
+++ b/tests/pillar/server_plugin_dirs.sls
@@ -0,0 +1,50 @@
+heat:
+  server:
+    enabled: true
+    region: RegionOne
+    version: liberty
+    stack_domain_admin:
+      name: heat_domain_admin
+      password: password
+      domain: heat
+    bind:
+      api_cfn:
+        address: 0.0.0.0
+      api_cloudwatch:
+        address: 0.0.0.0
+      api:
+        address: 127.0.0.1
+    database:
+      engine: mysql
+      host: 127.0.0.1
+      port: 3306
+      name: heat
+      user: heat
+      password: password
+    metadata:
+      host: 127.0.0.1
+      port: 8000
+    waitcondition:
+      host: 127.0.0.1
+      port: 8000
+    watch:
+      host: 127.0.0.1
+      port: 8003
+    identity:
+      engine: keystone
+      host: 127.0.0.1
+      port: 35357
+      tenant: service
+      user: heat
+      password: password
+    message_queue:
+      engine: rabbitmq
+      host: 127.0.0.1
+      port: 5672
+      user: openstack
+      password: password
+      virtual_host: '/openstack'
+    dir:
+      plugins:
+      - /test/dir1
+      - /test/dir2