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

Bug 2251879

Summary: [OSPdO 16.2] Openstackconfiggenerator fails to import custom network_data.yaml
Product: Red Hat OpenStack Reporter: Martin Schuppert <mschuppe>
Component: osp-director-operator-containerAssignee: OSP Team <rhos-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: high    
Version: 17.1 (Wallaby)CC: afrances, gcheresh, lmadsen, mariel, mburns, mschuppe, rhos-maint
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2251800 Environment:
Last Closed: 2024-10-23 13:44:22 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:
Bug Depends On: 2251800    
Bug Blocks:    

Description Martin Schuppert 2023-11-28 07:33:19 UTC
+++ This bug was initially created as a clone of Bug #2251800 +++

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