Bug 1593077

Summary: [RFE] openstack overcloud deploy parameter --environment-directory should be merged after -e params
Product: Red Hat OpenStack Reporter: jliberma <jliberma>
Component: python-tripleoclientAssignee: OSP Team <rhos-maint>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 17.0 (Wallaby)CC: augol, hbrock, jslagle, mburns, pweeks
Target Milestone: ---Keywords: Documentation, FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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: 1751888    

Description jliberma@redhat.com 2018-06-20 02:57:41 UTC
Description of problem:

Environment files in the --environment-directory are merged after -e params by openstack overcloud deploy.

This is a problem because the -e params typically included in a deploy command are templated requirements (like jinja templates)

If we specify a parameter in the environment directory, it will be overwritten by the included environment files.

For example:

exec openstack overcloud deploy \
        --templates /usr/share/openstack-tripleo-heat-templates \
        --timeout 90 \
        --verbose \
        -r /home/stack/templates/roles-data.yaml \
        -e /home/stack/templates/node-count.yaml \
        -e /usr/share/openstack-tripleo-heat-templates/environments/ceph-ansible/ceph-ansible.yaml \
        -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml \
        -e /home/stack/templates/docker-registry.yaml \
        --environment-directory /home/stack/templates/environments

If we define predictable IP addresses in templates/environments/30-predictable-ips.yaml, the _from_pool assignments will be overwritten by the default values in network-isolation.yaml.

(undercloud) [stack@undercloud ~]$ grep pool templates/environments/30-ips-from-pool-all.yaml | grep Compute
  OS::TripleO::Compute::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/external_from_pool.yaml
  OS::TripleO::Compute::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/internal_api_from_pool.yaml
  OS::TripleO::Compute::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_from_pool.yaml
  OS::TripleO::Compute::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/tenant_from_pool.yaml

[stack@undercloud plan]$ grep Compute::Ports user-environment.yaml
  OS::TripleO::Compute::Ports::ExternalPort: network/ports/external_from_pool.yaml
  OS::TripleO::Compute::Ports::InternalApiPort: network/ports/internal_api.yaml
  OS::TripleO::Compute::Ports::StorageMgmtPort: network/ports/noop.yaml
  OS::TripleO::Compute::Ports::StoragePort: network/ports/storage.yaml
  OS::TripleO::Compute::Ports::TenantPort: network/ports/tenant.yaml


To fix:

1. Ideally env files in the env-dir will be merged IN THE ORDER that they are listed in the command. IE -- after the -e params that come before them and before the -e params that come after. this is intuitive and works like the default behavior for -e params.
2. If #1 cannot be accomplished, -env-dir params should be merged AFTER -e params so that the -e params (which are typically system default includes generated by jinja templates with relative paths, therefore not easily moved to the --env-dir) are overwritten by what is in the env-dir.

Additional info:

Comment 1 pweeks 2021-01-08 16:01:14 UTC
Although this feature request seems logical to implement and one that would benefit customers.
The reality of having a large number of customers that have worked around the precedence ordering and would require mitigation of some sort to avoid breakage, we're suggesting this information be added to the documentation.
DF is happy to engage to provide the doc text necessary.
removing futurefeature tag