Deprecate default package installation for publishers

Since Pike in order to install package for publisher,
pkg field for publisher should be defined.

Change-Id: I4ca7004c322c1ab073934761563e88c1559cf37b
Related-Prod: https://mirantis.jira.com/browse/PROD-20427
diff --git a/README.rst b/README.rst
index a7bab40..23d6b1b 100644
--- a/README.rst
+++ b/README.rst
@@ -148,6 +148,22 @@
             host: 10.0.0.1
             port: 2003
 
+Since Pike release in order to install package for publisher, publisher definition should
+have pkg field explicitly set to needed package:
+
+.. code-block:: yaml
+
+    ceilometer:
+      server:
+        enabled: true
+        publisher:
+          example_publisher:
+            enabled: true
+            url: publisher_url://
+            pkg: publisher-pkg-name
+
+
+
 Ceilometer compute agent
 ------------------------
 
diff --git a/ceilometer/agent.sls b/ceilometer/agent.sls
index 661da46..679c632 100644
--- a/ceilometer/agent.sls
+++ b/ceilometer/agent.sls
@@ -61,6 +61,7 @@
 
 {%- for publisher_name, publisher in agent.get('publisher', {}).items() %}
 
+{%- if agent.version in ['liberty', 'juno', 'kilo', 'mitaka', 'newton', 'ocata'] %}
 {%- if publisher_name not in ['default', 'gnocchi', 'panko'] %}
 
 ceilometer_publisher_{{ publisher_name }}_pkg:
@@ -68,6 +69,15 @@
     - name: ceilometer-publisher-{{ publisher_name }}
 
 {%- endif %}
+{%- elif publisher.get('enabled', False) %}
+{%- if publisher.pkg is defined %}
+
+ceilometer_publisher_{{ publisher_name }}_pkg:
+  pkg.latest:
+    - name: {{ publisher.pkg }}
+
+{%- endif %}
+{%- endif %}
 
 {%- endfor %}
 
diff --git a/ceilometer/server.sls b/ceilometer/server.sls
index 3001d05..83f9057 100644
--- a/ceilometer/server.sls
+++ b/ceilometer/server.sls
@@ -113,6 +113,7 @@
 
 {%- for publisher_name, publisher in server.get('publisher', {}).items() %}
 
+{%- if server.version in ['liberty', 'juno', 'kilo', 'mitaka', 'newton', 'ocata'] %}
 {%- if publisher_name not in ['default', 'gnocchi', 'panko'] %}
 
 ceilometer_publisher_{{ publisher_name }}_pkg:
@@ -120,8 +121,16 @@
     - name: ceilometer-publisher-{{ publisher_name }}
 
 {%- endif %}
+{%- elif publisher.get('enabled', False) %}
+{%- if publisher.pkg is defined %}
 
-{%- if publisher_name == 'gnocchi' and publisher.enabled == true %}
+ceilometer_publisher_{{ publisher_name }}_pkg:
+  pkg.latest:
+    - name: {{ publisher.pkg }}
+
+{%- endif %}
+
+{%- if publisher_name == 'gnocchi' %}
 
 ceilometer_gnocchiclient_pkg:
   pkg.latest:
@@ -149,6 +158,7 @@
 
 {%- endif %}
 {%- endif %}
+{%- endif %}
 
 {%- endfor %}