Unhardocde policy file path

PROD-33618

Change-Id: I942de94fb57e7a6d9b5765e62a9403babee19124
diff --git a/ceilometer/files/queens/ceilometer-agent.conf.Debian b/ceilometer/files/queens/ceilometer-agent.conf.Debian
index 84b5333..cd53b80 100644
--- a/ceilometer/files/queens/ceilometer-agent.conf.Debian
+++ b/ceilometer/files/queens/ceilometer-agent.conf.Debian
@@ -512,6 +512,12 @@
 {%- include "oslo_templates/files/queens/oslo/messaging/_" + messaging_engine + ".conf" %}
 {%- endif %}
 
+[oslo_policy]
+{%- if agent.oslo_policy is defined %}
+{%- set _data = agent.oslo_policy %}
+{%- include "oslo_templates/files/queens/oslo/_policy.conf" %}
+{%- endif %}
+
 {%- if agent.configmap is defined %}
 {%- set _data = agent.configmap %}
 {%- include "oslo_templates/files/configmap/configmap.conf" %}
diff --git a/ceilometer/files/queens/ceilometer-server.conf.Debian b/ceilometer/files/queens/ceilometer-server.conf.Debian
index 5676d09..d962ac9 100644
--- a/ceilometer/files/queens/ceilometer-server.conf.Debian
+++ b/ceilometer/files/queens/ceilometer-server.conf.Debian
@@ -525,6 +525,12 @@
 {%- include "oslo_templates/files/queens/oslo/messaging/_" + messaging_engine + ".conf" %}
 {%- endif %}
 
+[oslo_policy]
+{%- if server.oslo_policy is defined %}
+{%- set _data = server.oslo_policy %}
+{%- include "oslo_templates/files/queens/oslo/_policy.conf" %}
+{%- endif %}
+
 {%- if server.configmap is defined %}
 {%- set _data = server.configmap %}
 {%- include "oslo_templates/files/configmap/configmap.conf" %}
diff --git a/ceilometer/map.jinja b/ceilometer/map.jinja
index 492afa7..1288148 100644
--- a/ceilometer/map.jinja
+++ b/ceilometer/map.jinja
@@ -23,6 +23,9 @@
             }
           },
         },
+        'oslo_policy': {
+          'policy_file': 'policy.json'
+        },
     },
     'RedHat': {
         'enabled': false,
@@ -40,6 +43,9 @@
             }
           },
         },
+        'oslo_policy': {
+          'policy_file': 'policy.json'
+        },
     },
 }, merge=salt['pillar.get']('ceilometer:agent', {}), base='BaseDefaults') %}
 
@@ -95,6 +101,9 @@
             }
           },
         },
+        'oslo_policy': {
+          'policy_file': 'policy.json'
+        },
     }
 }, merge=salt['pillar.get']('ceilometer:server',{}), base='BaseDefaults') %}
 
diff --git a/ceilometer/server.sls b/ceilometer/server.sls
index 3b2056d..e264f8c 100644
--- a/ceilometer/server.sls
+++ b/ceilometer/server.sls
@@ -111,12 +111,23 @@
 
 {%- endif %}
 
+{%- if server.version not in ["juno", "kilo", "liberty", "mitaka", "newton", "ocata", "pike"] %}
+{#- Since Queens release `policy.json` is changed to `policy.yaml`. But default option in `oslo_policy` is `policy.json` #}
+/etc/ceilometer/{{ server.get('oslo_policy', {}).get('policy_file', 'policy.json') }}:
+  file.managed:
+    - mode: 0640
+    - user: root
+    - group: ceilometer
+    - require:
+      - pkg: ceilometer_server_packages
+{%- endif %}
+
 {%- for name, rule in server.get('policy', {}).items() %}
 
 {%- if rule != None %}
 ceilometer_keystone_rule_{{ name }}_present:
   keystone_policy.rule_present:
-  - path: /etc/ceilometer/policy.json
+  - path: /etc/ceilometer/{{ server.get('oslo_policy', {}).get('policy_file', 'policy.json') }}
   - name: {{ name }}
   - rule: {{ rule }}
   - require:
@@ -126,7 +137,7 @@
 
 ceilometer_keystone_rule_{{ name }}_absent:
   keystone_policy.rule_absent:
-  - path: /etc/ceilometer/policy.json
+  - path: /etc/ceilometer/{{ server.get('oslo_policy', {}).get('policy_file', 'policy.json') }}
   - name: {{ name }}
   - require:
     - pkg: ceilometer_server_packages