Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2251800

Summary: [OSPdO 17.1] Openstackconfiggenerator fails to import custom network_data.yaml
Product: Red Hat OpenStack Reporter: Andrea Franceschini <afrances>
Component: osp-director-operator-containerAssignee: Martin Schuppert <mschuppe>
Status: CLOSED ERRATA QA Contact:
Severity: urgent Docs Contact:
Priority: high    
Version: 17.1 (Wallaby)CC: chjones, jschluet, mariel, mburns, mschuppe, pkomarov
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: osp-director-operator-container-1.3.1-12 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2251879 (view as bug list) Environment:
Last Closed: 2024-01-16 16:25:01 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: 2251879    

Description Andrea Franceschini 2023-11-27 17:23:37 UTC
Description of problem:

In the documentation for ops-director-operator 17.1, it refers to the possibility to use a custom network_data.yaml, putting it in the tarball configmap used by openstackconfigenerator.

apiVersion: osp-director.openstack.org/v1beta1
kind: OpenStackConfigGenerator
metadata:
  name: default
  namespace: openstack
spec:
  enableFencing: true
...
...
  heatEnvConfigMap: heat-env-config
  heatEnvs:
  - ssl/tls-endpoints-public-ip.yaml
  - ssl/enable-tls.yaml
  tarballConfigMap: tripleo-tarball-config

Actually the custom network_data.yaml provided in the tarball config get overridden by the OSPdO generated network_data.yaml

this is because of this snippet of code in the create_playbook.sh script, that is run during the generate-config-default's job.

--------------------
# copy to editable dir config-tmp
rm -Rf $HOME/config-tmp
mkdir -p $HOME/config-tmp
pushd $HOME/config-tmp
# extract any tar files into $HOME/config-tmp
tar -xvf $HOME/tht-tars/custom-config.tar.gz
cp $HOME/config/* $HOME/config-tmp
cp $HOME/config-custom/* $HOME/config-tmp
# remove all references to the default tht dir
sed -e "s|/usr/share/openstack\-tripleo\-heat\-templates|\.|" -i $HOME/config-tmp/*.yaml
# copy to our temp t-h-t dir
cp -a $HOME/config-tmp/* "$TEMPLATES_DIR/"
--------------------

The problem is that the custom network_data.yaml is contained in the tarball, while the $HOME/config dir contains the generated one.

As you may see, the tarball is first extracted in the config-tmp dir
Then the content of $HOME/config are copied over , overwriting the custom network_data.yaml with the default one.

Version-Release number of selected component (if applicable):


How reproducible:

put the custom network_data.yaml in custom_template directory to produce the tarball

Steps to Reproduce:
1. Create the configmap for the tarballconfig
2. Run the openstackconfiggenerator


Actual results:

the default network_data.yaml is used

Expected results:

the custom network_data.yaml is used

Comment 11 errata-xmlrpc 2024-01-16 16:25:01 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 (Updated Red Hat OpenStack Platform 17.1.2 director Operator container images), 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-2024:0263