Bug 2042429

Summary: Multivalued options created with wrong syntax
Product: Red Hat OpenStack Reporter: Eric Nothen <enothen>
Component: puppet-keystoneAssignee: Douglas Mendizábal <dmendiza>
Status: CLOSED ERRATA QA Contact: Jeremy Agee <jagee>
Severity: medium Docs Contact:
Priority: high    
Version: 17.0 (Wallaby)CC: ansmith, aromito, chjones, chris.brown, dabarzil, djuran, dmendiza, jerward, jjoyce, jschluet, lmiccini, michele, moddi, mtenheuv, nlevinki, nnavarat, rhos-maint, satmakur, schhabdi, slinaber, tvignaud
Target Milestone: betaKeywords: Triaged
Target Release: 17.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: puppet-keystone-18.5.1-0.20220628111339.2606fdf.el9ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1608389 Environment:
Last Closed: 2022-09-21 12:18:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Eric Nothen 2022-01-19 14:04:08 UTC
+++ This bug was initially created as a clone of Bug #1608389 +++

Description of problem:
The keystone notification driver is a multivalued parameter, i.e. several drivers can be enabled. 

To do this from Director, I'm using the following:

  ControllerExtraConfig:
    keystone::notification_driver:
      - "log"
      - "messagingv2"


This produces the following configuration on /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf:

[oslo_messaging_notifications]
driver=log,messagingv2

Which causes the following error on /var/log/containers/keystone/keystone.log:

2022-01-19 12:46:11.727 35 WARNING stevedore.named [req-36361896-1650-4275-bdfb-70ab55fd2377 - - - - -] Could not load log,messagingv2


As reported on the original BZ, configuration should be multi-line:

[oslo_messaging_notifications]
driver=log
driver=messagingv2

Comment 2 Eric Nothen 2022-01-20 08:54:12 UTC
Workaround for this issue using a NodeExtraConfigPost, as detailed on [1]


# 1. Environment file required for cadf, with multiple drivers for Keystone:

[stack.lab ~]$ cat templates/keystone.yaml 
parameter_defaults:
  NotificationDriver: "messagingv2"
  KeystoneNotificationTopics: "notifications"
  KeystoneRegion: TESTREGION
  KeystoneNotificationFormat: "cadf"
  ControllerExtraConfig:
    keystone::notification_driver:
      - "log"
      - "messagingv2"
    cinder::ceilometer::notification_driver: "log"
    glance::notify::rabbitmq::notification_driver: "log"
    heat::notification_driver: "log"
    neutron::notification_driver: "log"
    nova::notification_driver: "log"
    keystone::config::keystone_config:
      DEFAULT/notification_opt_out:
        value: "identity.authenticate.pending"


# 2. ConfigPost environment file:

[stack.lab ~]$ cat templates/overcloud-post.yaml 
resource_registry:
  OS::TripleO::NodeExtraConfigPost: /home/stack/post-deploy/keystone-driver-fix.yaml


# 3. Heat template that fixes keystone.conf:

[stack.lab ~]$ cat post-deploy/keystone-driver-fix.yaml 
heat_template_version: rocky

description: >
  Workaround to the [oslo_messaging_notifications]driver issue reported on BZ#2042429

parameters:
  servers:
    type: json
  DeployIdentifier:
    type: string
  EndpointMap:
    default: {}
    type: json

resources:
  CustomExtraConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      group: script
      config: |
        #!/bin/bash
        set -x
        if [ -f /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf ] ;then
            sed -i 's/\(^driver\)=\(.*\),\(.*\)$/\1=\2\n\1=\3/' /var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf && \
            systemctl restart tripleo_keystone.service
        fi

  CustomExtraDeployments:
    type: OS::Heat::SoftwareDeploymentGroup
    properties:
      servers:  {get_param: servers}
      config: {get_resource: CustomExtraConfig}
      actions: ['CREATE','UPDATE']
      input_values:
        deploy_identifier: {get_param: DeployIdentifier}

[stack.lab ~]$ 


[1] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/advanced_overcloud_customization/index#sect-Customizing_Overcloud_PostConfiguration_All

Comment 3 Eric Nothen 2022-03-17 16:36:01 UTC
Hey, not urgent I know, but would it be possible to review this BZ and assign a target milestone, so that I can tell my customer on which Z stream to expect a fix?

Comment 6 Luca Miccini 2022-06-27 05:10:26 UTC
wallaby backport: https://review.opendev.org/c/openstack/puppet-keystone/+/847439

Comment 20 dabarzil 2022-08-30 14:11:16 UTC
verified:
[root@controller-0 ~]# rpm -qa| grep puppet-keystone-18.5.1-0.20220628111339.2606fdf.el9ost
puppet-keystone-18.5.1-0.20220628111339.2606fdf.el9ost.noarch

[root@controller-0 ~]# grep -A 15 'oslo_messaging_notifications' /var/lib/config-data/puppet-generated/keystone/etc/keystone/ -r
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf:[oslo_messaging_notifications]
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-#
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-# From oslo.messaging
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-#
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-# The Drivers(s) to handle sending notifications. Possible values are
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-# messaging, messagingv2, routing, log, test, noop (multi valued)
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-# Deprecated group/name - [DEFAULT]/notification_driver
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-#driver =
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-driver=log
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-driver=messagingv2
/var/lib/config-data/puppet-generated/keystone/etc/keystone/keystone.conf-

Comment 24 errata-xmlrpc 2022-09-21 12:18:51 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 (Release of components for Red Hat OpenStack Platform 17.0 (Wallaby)), 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/RHEA-2022:6543