<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>The problems you're describing are close to the discussion we had with Mathieu Bultel here [1]. Currently to set some parameters values as ultimate source of truth, you need to put them in plan-environment.yaml. Ignoring the fact that CLI now merges environments itself (fixed by [2] and not affecting this behaviour), the Mistral workflows pass the environments to heat in order in which they are provided with -e option and then as last environment it applies parameter_defaults from plan-environment.yaml.</div><div>The result of [1] effort is going to be that the way deployment configuration (roles setting, networks selection, environments selection and explicit parameters setting) is going to be done the same by both CLI and GUI through Mistral Workflows which already exist but are used only by GUI. When you look at plan-environment.yaml in Swift, you can see the list of environment files in order in which they're merged as well as parameters which are going to override the values in environments in case of collision.</div><div><br></div><div>Merging strategy for parameters is an interesting problem, configuring this in t-h-t looks like a good solution to me. Note that the GUI always displays the parameter values which it is getting from GetParameters Mistral action. This action gets the parameter values from Heat by running heat validate. This means that it always displays the real parameter values which are actually going to be applied by Heat as a result of all the merging. If user updates that value with GUI it will end up being set in plan-environment.yaml.</div><div><br></div><div>-- Jirka</div><div><br></div><br class="gmail-Apple-interchange-newline"><div><br></div><div><br></div><div>[1] <a href="http://lists.openstack.org/pipermail/openstack-dev/2018-September/134511.html" target="_blank">http://lists.openstack.org/pipermail/openstack-dev/2018-September/134511.html</a></div><div><div>[2] <a href="https://review.openstack.org/#/c/448209/" target="_blank">https://review.openstack.org/#/c/448209/</a></div><br class="gmail-Apple-interchange-newline"></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 4, 2018 at 9:54 AM Kamil Sambor <<a href="mailto:ksambor@redhat.com" target="_blank">ksambor@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I want to start discussion on: how to solve issue with merging environment<br>
values in TripleO.<br>
<br>
Description:<br>
In TripleO we experience some issues related to setting parameters in heat<br>
templates. First, it isn't possible to set some params as ultimate source<br>
of truth (disallow to overwrite param in other heat templates). Second it<br>
isn't possible to merge values from different templates [0][1].<br>
Both features are implemented in heat and can be easly used in templates.[2][3]<br>
This doesn't work in TripleO because we overwrite all values in template in<br>
python client instead of aggregating them etc. orsimply let heat do the<br>
job .[4][5]<br>
<br>
Solution:<br>
Example solutions are: we can fix how python tripleo client works with env<br>
and templates and enable heat features or we can write some puppet code<br>
that will work similar to firewall code [6] and will support aggregate and<br>
merge values that we point out. Both solutions have pros and cons but IMHO<br>
solution which give heat to do job is preferable. But solution with merging<br>
give us possibilities to have full control on merging of environments.<br>
<br>
Problems:<br>
Only few as a start: With both solutions we will have the same problem,<br>
porting new patches which will use this functionalities to older version of<br>
rhel. Also upgrades can be really problematic to new version. Also changes<br>
which will enable heat feature will totally change how templates work and we<br>
will need to change all templates and change default behavior (which is merge<br>
params) to override behavior and also add posibilities to run temporaly old<br>
behavior.<br>
<br>
On the end, I prepared two patchsets with two PoC in progress. First one with<br>
merging env in tripleo client but with using heat merging functionality:<br>
<a href="https://review.openstack.org/#/c/599322/" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/599322/</a> . And second where we ignore merget<br>
env and move all files and add them into deployment plan enviroments.<br>
<a href="https://review.openstack.org/#/c/599559/" rel="noreferrer" target="_blank">https://review.openstack.org/#/c/599559/</a><br>
<br>
What do you think about each of solution?Which solution should be used<br>
in TripleO?<br>
<br>
Best,<br>
Kamil Sambor<br>
<br>
[0] <a href="https://bugs.launchpad.net/tripleo/+bug/1716391" rel="noreferrer" target="_blank">https://bugs.launchpad.net/tripleo/+bug/1716391</a><br>
[1] <a href="https://bugs.launchpad.net/heat/+bug/1635409" rel="noreferrer" target="_blank">https://bugs.launchpad.net/heat/+bug/1635409</a><br>
[2] <a href="https://docs.openstack.org/heat/pike/template_guide/environment.html#restrict-update-or-replace-of-a-given-resource" rel="noreferrer" target="_blank">https://docs.openstack.org/heat/pike/template_guide/environment.html#restrict-update-or-replace-of-a-given-resource</a><br>
[3] <a href="https://docs.openstack.org/heat/pike/template_guide/environment.html#environment-merging" rel="noreferrer" target="_blank">https://docs.openstack.org/heat/pike/template_guide/environment.html#environment-merging</a><br>
[4] <a href="https://github.com/openstack/python-tripleoclient/blob/master/tripleoclient/utils.py#L1019" rel="noreferrer" target="_blank">https://github.com/openstack/python-tripleoclient/blob/master/tripleoclient/utils.py#L1019</a><br>
[5] <a href="https://github.com/openstack/python-heatclient/blob/f73c2a4177377b710a02577feea38560b00a24bf/heatclient/common/template_utils.py#L191" rel="noreferrer" target="_blank">https://github.com/openstack/python-heatclient/blob/f73c2a4177377b710a02577feea38560b00a24bf/heatclient/common/template_utils.py#L191</a><br>
[6] <a href="https://github.com/openstack/puppet-tripleo/tree/master/manifests/firewall" rel="noreferrer" target="_blank">https://github.com/openstack/puppet-tripleo/tree/master/manifests/firewall</a><br>
<br>
__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" rel="noreferrer" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" rel="noreferrer" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
</blockquote></div>