Manage minion.d using support metadata

Change-Id: I4fb2bce2d160a0735cc4e01ff4732e31a360685e
diff --git a/.kitchen.yml b/.kitchen.yml
index 29774f4..73f2e37 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -2,7 +2,7 @@
 driver:
   name: docker
   hostname: keystone.ci.local
-  use_sudo: true
+  use_sudo: false
 
 provisioner:
   name: salt_solo
diff --git a/keystone/client/project.sls b/keystone/client/project.sls
index bb0d30e..856c78f 100644
--- a/keystone/client/project.sls
+++ b/keystone/client/project.sls
@@ -3,13 +3,6 @@
 
 {%- if client.tenant is defined %}
 
-keystone_salt_config:
-  file.managed:
-    - name: /etc/salt/minion.d/keystone.conf
-    - template: jinja
-    - source: salt://keystone/files/salt-minion.conf
-    - mode: 600
-
 keystone_client_roles:
   keystone.role_present:
   - names: {{ client.roles }}
@@ -17,8 +10,6 @@
   - connection_password: {{ client.server.password }}
   - connection_tenant: {{ client.server.tenant }}
   - connection_auth_url: 'http://{{ client.server.host }}:{{ client.server.public_port }}/v2.0/'
-  - require:
-    - file: keystone_salt_config
 
 {%- for tenant_name, tenant in client.get('tenant', {}).iteritems() %}
 
diff --git a/keystone/client/service.sls b/keystone/client/service.sls
index efdef37..40c68df 100644
--- a/keystone/client/service.sls
+++ b/keystone/client/service.sls
@@ -5,10 +5,4 @@
   pkg.installed:
   - names: {{ client.pkgs }}
 
-keystone_profile:
-  file.managed:
-  - name: /etc/salt/minion.d/_keystone.conf
-  - source: salt://keystone/files/keystone.conf
-  - template: jinja
-
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/keystone/files/salt-minion.conf b/keystone/files/salt-minion.conf
deleted file mode 100644
index 19c5af9..0000000
--- a/keystone/files/salt-minion.conf
+++ /dev/null
@@ -1,15 +0,0 @@
-{%- if pillar.keystone.get('server', {'enabled': False}).enabled -%}
-{%- from "keystone/map.jinja" import server with context -%}
-keystone.token: '{{ server.service_token }}'
-keystone.endpoint: 'http://{{ server.bind.address }}:{{ server.bind.private_port }}/v2.0'
-{%- else -%}
-{%- from "keystone/map.jinja" import client with context -%}
-keystone.user: '{{ client.server.user }}'
-keystone.password: '{{ client.server.password }}'
-keystone.tenant: '{{ client.server.tenant }}'
-keystone.auth_url: 'http://{{ client.server.host }}:{{ client.server.public_port }}/v2.0/'
-{%- endif %}
-
-{#-
-vim: syntax=jinja
--#}
diff --git a/keystone/meta/salt.yml b/keystone/meta/salt.yml
index c5f5e3a..8961ec1 100644
--- a/keystone/meta/salt.yml
+++ b/keystone/meta/salt.yml
@@ -7,3 +7,22 @@
   control:
     priority: 520
 
+minion:
+  {% if pillar.keystone.server is defined or pillar.keystone.client is defined %}
+  keystone:
+    {%- if pillar.keystone.get('server', {'enabled': False}).enabled -%}
+    {%- from "keystone/map.jinja" import server with context -%}
+    keystone.token: '{{ server.service_token }}'
+    keystone.endpoint: 'http://{{ server.bind.address }}:{{ server.bind.private_port }}/v2.0'
+    {%- else -%}
+    {%- from "keystone/map.jinja" import client with context -%}
+    keystone.user: '{{ client.server.user }}'
+    keystone.password: '{{ client.server.password }}'
+    keystone.tenant: '{{ client.server.tenant }}'
+    keystone.auth_url: 'http://{{ client.server.host }}:{{ client.server.public_port }}/v2.0/'
+    {%- endif %}
+  {%- endif %}
+
+{#-
+vim: syntax=jinja
+-#}
diff --git a/keystone/server.sls b/keystone/server.sls
index 384911f..4e0c12d 100644
--- a/keystone/server.sls
+++ b/keystone/server.sls
@@ -30,13 +30,6 @@
 
 {%- endif %}
 
-keystone_salt_config:
-  file.managed:
-    - name: /etc/salt/minion.d/keystone.conf
-    - template: jinja
-    - source: salt://keystone/files/salt-minion.conf
-    - mode: 600
-
 {%- if not salt['user.info']('keystone') %}
 
 keystone_user:
@@ -264,7 +257,6 @@
   - connection_endpoint: 'http://{{ server.bind.address }}:{{ server.bind.private_port }}/v2.0'
   - require:
     - cmd: keystone_syncdb
-    - file: keystone_salt_config
 
 keystone_admin_tenant:
   keystone.tenant_present:
@@ -322,7 +314,6 @@
   - connection_endpoint: 'http://{{ server.bind.address }}:{{ server.bind.private_port }}/v2.0'
   - require:
     - keystone: keystone_{{ service_name }}_service
-    - file: keystone_salt_config
 
 {% if service.user is defined %}