<div dir="ltr"><div dir="ltr">On Thu, Oct 29, 2020 at 4:59 PM Bogdan Dobrelya <<a href="mailto:bdobreli@redhat.com">bdobreli@redhat.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
In today TripleO client development we invoke ansible playbooks instead <br>
of Mistral workflows. I believe this may only be justified for <br>
non-trivial things. Otherwise please just import python modules into the <br>
client command actions without introducing additional moving parts in <br>
the form of ansible modules (that import the same python modules as well).<br>
<br>
Ansible brings declarative DSL that sometimes can better and simpler and <br>
faster describes things to do and shape inputs data, than if the same <br>
would be done in python, in the client.<br>
<br>
What should be the trivial thing and non-trivial then?<br>
<br></blockquote><div><div><br></div><div>Yes, we did create a number of playbooks/ansible modules for some trivial things starting with <a href="https://review.opendev.org/#/c/716286/">https://review.opendev.org/#/c/716286/</a> (I had a comment about it in that patch and it seems you reviewed the patch too), that could have been achieved by making a simple tripleo-common api calls.  <br></div><div><br></div><div>IMO, creating playbooks for every cli action and moving all logic from tripleoclient to ansible modules/playboos would have helped us in either getting rid of tripleoclient or make it very thin. We did discuss that in the victoria PTG[1]. Agreed that we would  end up with some inefficient stuff (like what you've mentioned) during the transition and later, but the user experience with ansible playbooks compared to current logging in cli actions would have outweighed that.</div><div><br></div><div>However, over the last cycle I've seen some resistance to  go in that direction (i.e moving everything from tripleoclient to playbooks/role/ansible mddules), If we want to keep some stuff in tripleolcient (and some in ansible modules/playbooks), then I would agree we should not make it complex by writing playbooks/modules for things that could be achieved by simple tripleo-common api calls.</div><div><br></div><div>[1] <a href="https://etherpad.opendev.org/p/tripleo-future-of-tripleoclient">https://etherpad.opendev.org/p/tripleo-future-of-tripleoclient</a></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Well, I think that example [0] illustrates such a trivial thing. A new <br>
playbook [1] would only install a few packages then "returns" back into <br>
python and calls a new ansible module [2]. And that new module only <br>
wraps [3] the same code being removed from the client:<br>
<br></blockquote> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
from tripleo_common.image import build<br>
...<br>
manager = build.ImageBuildManager(<args>)<br>
<br>
I see no point of adding a new playbook and a new module for that <br>
trivial example. Those 4 packages could (and should) be as well <br>
installed from the client caller code without any ansible involved in <br>
the middle IMO.<br>
<br>
[0] <a href="https://review.opendev.org/#/c/759954/" rel="noreferrer" target="_blank">https://review.opendev.org/#/c/759954/</a><br>
<br>
[1] <br>
<a href="https://review.opendev.org/#/c/759953/3/tripleo_ansible/playbooks/cli-overcloud-image-build.yaml" rel="noreferrer" target="_blank">https://review.opendev.org/#/c/759953/3/tripleo_ansible/playbooks/cli-overcloud-image-build.yaml</a><br>
<br>
[2] <br>
<a href="https://review.opendev.org/#/c/759953/3/tripleo_ansible/ansible_plugins/modules/tripleo_overcloud_image_build.py@26" rel="noreferrer" target="_blank">https://review.opendev.org/#/c/759953/3/tripleo_ansible/ansible_plugins/modules/tripleo_overcloud_image_build.py@26</a><br>
<br>
-- <br>
Best regards,<br>
Bogdan Dobrelya,<br>
Irc #bogdando<br>
<br>
<br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Regards,</div>Rabi Mishra<div><br></div></div></div></div></div></div>