<div dir="ltr">I've a weird one that I'm hoping some OpenStack Ansible folk can help with.<div><br></div><div>I'm installing OpenStack-Ansible 15.1.7 (Ocata) and wanted to include Telemetry.</div><div>So far so good on an install, but I noticed the policy.json files are screwing up, causing errors.</div><div><br></div><div>The containers (API, polling) get the following contents for /etc/ceilometer/policy.json which cause an error - it's invalid syntax:</div><div><br></div><div>







<p class="gmail-p1"><font face="monospace, monospace"><span class="gmail-s1">{</span><span class="gmail-s2">'telemetry:create_samples'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:query_sample'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:get_resources'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:get_meters'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'segregation'</span><span class="gmail-s3">: </span><span class="gmail-s2">u'rule:context_is_admin'</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:get_resource'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'context_is_admin'</span><span class="gmail-s3">: </span><span class="gmail-s2">u'role:admin'</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:get_sample'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:compute_statistics'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s3">, </span><span class="gmail-s2">'telemetry:get_samples'</span><span class="gmail-s3">: </span><span class="gmail-s2">u''</span><span class="gmail-s1">}</span></font></p><p class="gmail-p1">However the policy.json files it is meant to use as  default, if I try and follow the ansible code chain should be:</p><pre style="color:rgb(0,0,0)">{
    "context_is_admin": "role:admin",
    "segregation": "rule:context_is_admin",

    "telemetry:get_samples": "",
    "telemetry:get_sample": "",
    "telemetry:query_sample": "",
    "telemetry:create_samples": "",

    "telemetry:compute_statistics": "",
    "telemetry:get_meters": "",

    "telemetry:get_resource": "",
    "telemetry:get_resources": "",
}</pre><pre><font face="arial, helvetica, sans-serif" style="color:rgb(0,0,0)">Note different formatting and content. These are pulled in during the install from the git config locations, e.g. </font><font color="#000000" face="arial, helvetica, sans-serif"><a href="https://git.openstack.org/cgit/openstack/ceilometer/plain/etc/ceilometer/policy.json">https://git.openstack.org/cgit/openstack/ceilometer/plain/etc/ceilometer/policy.json</a>.</font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">I can't find out where it is trying to get the incorrectly set "overrides" from - but it definitely has found some to use:</font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">(Output from an os-ceilometer-install.yml run - you can see it rather unhelpfully making up its own contents and getting it wrong)</font></pre><pre style="color:rgb(0,0,0)"><p class="gmail-p1"><span class="gmail-s1">TASK [os_ceilometer : Copy ceilometer configuration files] *********************</span></p><p class="gmail-p1"><span class="gmail-s1">Monday 14 August 2017<span class="gmail-Apple-converted-space">  </span>13:03:24 +0000 (0:00:03.396) <span class="gmail-Apple-converted-space">      </span>0:00:36.739 *********<span class="gmail-Apple-converted-space"> </span></span></p><p class="gmail-p1"><span class="gmail-s1"><span class="gmail-Apple-converted-space"><snip></span></span></p><p class="gmail-p1"><span class="gmail-s1">ok: [controller-01_ceilometer_collector_container-4ca9e11a] => (item={u'dest': u'/etc/ceilometer/policy.json-15.1.7', u'config_overrides': {}, u'config_type': u'json', u'content': {'telemetry:create_samples': u'', 'telemetry:query_sample': u'', 'telemetry:get_meters': u'', 'telemetry:get_sample': u'', 'telemetry:compute_statistics': u'', 'telemetry:get_samples': u'', 'telemetry:get_resource': u'', 'segregation': u'rule:context_is_admin', 'context_is_admin': u'role:admin', 'telemetry:get_resources': u''}})</span></p><snip></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">I've tried setting my own ceilometer_policy_overrides in user_variables.yml but it just causes a different error (weirdly and possibly related in a weird bug kinda way to the next task which is the polling policy.) </font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">Can someone help work out what is going on?</font></pre><pre><font face="arial, helvetica, sans-serif" style="color:rgb(0,0,0)">My configs for ceilometer are simple, nothing deviating from: </font><font color="#000000" face="arial, helvetica, sans-serif"><a href="https://docs.openstack.org/openstack-ansible-os_ceilometer/latest/">https://docs.openstack.org/openstack-ansible-os_ceilometer/latest/</a> (and using all defaults apart from what I need set as described below):</font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">I set the hosts in /etc/openstack_deploy/conf.d/ceilometer.yml and a</font><span style="font-family:arial,helvetica,sans-serif">ny configuration for backends for ceilometer and what services to enable ceilometer for in /etc/openstack_deploy/user_variables.yml. Then run the install.</span> </pre><pre><font face="arial, helvetica, sans-serif"><font color="#000000">Note that when I manually copy the policy.json from the git locations, ceilometer then works, but I obviously need this automated/fixed in a far better way. </font></font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">Cheers!</font></pre><pre style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">Kev</font></pre></div></div>