Bug 1927180

Summary: TripleO fails to apply custom IronicApiPolicies because openstack-ironic-api container image is shipped with /etc/ironic/policy.json in incorrect format
Product: Red Hat OpenStack Reporter: Alex Stupnikov <astupnik>
Component: openstack-ironicAssignee: Steve Baker <sbaker>
Status: CLOSED ERRATA QA Contact: Paras Babbar <pbabbar>
Severity: medium Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: ealcaniz, lhh, pbabbar, pweeks, sbaker
Target Milestone: z7Keywords: Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: openstack-ironic-13.0.7-1.20210603224533.3d77e61.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1927181 (view as bug list) Environment:
Last Closed: 2021-12-09 20:18:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1927181    

Description Alex Stupnikov 2021-02-10 09:55:48 UTC
Description of problem:

This problem was originally reported by customer with RHOSP 13 deployment. When customer tried deployment command with custom IronicApiPolicies it failed with error [1] (I replaced rule, it is irrelevant in this case).

From customer's investigation it looks like this problem is caused by the fact that openstack-ironic-api container image is shipped with /etc/ironic/policy.json in incorrect JSON format (lots of commented lines, which doesn't look like a valid JSON). It looks like this file is coming from openstack-ironic-common RPM

I have decided to report this bug for RHOSP 16 first because the situation is the same there, although I didn't try to reproduce the problem.


[1]
Warning: Augeas[/etc/ironic/policy.json-RULE-add](provider=augeas): Loading failed for one or more files, see debug for /augeas//error output
Error: /Stage[main]/Ironic::Policy/Openstacklib::Policy::Base[RULE_NAME]/Augeas[/etc/ironic/policy.json-baremetal:RULE-add]: Could not evaluate: Saving failed, see debug


Steps to Reproduce:
1. Define IronicApiPolicies according to our official recommendations and run deployment command

Actual results:
Deployment command fails with error [1] because augeas fails to parse policy.json: https://github.com/openstack/puppet-openstacklib/blob/stable/queens/manifests/policy/base.pp#L48-L57

Expected results:
Custom policies are added to /etc/ironic/policy.json inside ironic_api container and applied.

Comment 40 errata-xmlrpc 2021-12-09 20:18:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1.7 (Train) bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:3762