<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="text-align:left; direction:ltr;">
<div>On Thu, 2020-10-29 at 07:00 -0600, Alex Schultz wrote:</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre>On Thu, Oct 29, 2020 at 5:32 AM Bogdan Dobrelya <</pre>
<a href="mailto:bdobreli@redhat.com">
<pre>bdobreli@redhat.com</pre>
</a>
<pre>> wrote:</pre>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre><br></pre>
<pre>In today TripleO client development we invoke ansible playbooks instead</pre>
<pre>of Mistral workflows. I believe this may only be justified for</pre>
<pre>non-trivial things. Otherwise please just import python modules into the</pre>
<pre>client command actions without introducing additional moving parts in</pre>
<pre>the form of ansible modules (that import the same python modules as well).</pre>
<pre><br></pre>
</blockquote>
</blockquote>
<pre><snip></pre>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<pre><br></pre>
<pre>I see no point of adding a new playbook and a new module for that</pre>
<pre>trivial example. Those 4 packages could (and should) be as well</pre>
<pre>installed from the client caller code without any ansible involved in</pre>
<pre>the middle IMO.</pre>
</blockquote>
<pre><br></pre>
<pre>While I can agree to a certain extent, there's actually some good</pre>
<pre>reasons to even move trivial bits into ansible. Personally I'm not</pre>
<pre>certain the switch to using ansible under the covers from some cli</pre>
<pre>actions is an improvement (questionable logging, error handling isn't</pre>
<pre>great), there is a case for certain actions. As we discussed at the</pre>
<pre>PTG, the overcloud image building process is one of those things that</pre>
<pre>actually has to be executed on bare metal. If we wanted to continue to</pre>
<pre>look at containerizing the cli, we need to be able to invoke this</pre>
<pre>action from within the container but build on an external host. This</pre>
<pre>is something that is trivial with the switch to an ansible playbook</pre>
<pre>that isn't available when running under the pure python as it exists</pre>
<pre>today.  Container builds would be another example action that is</pre>
<pre>required to run on a bare metal host. Additionally the movement of</pre>
<pre>this invocation to an ansible module also allows the action to be</pre>
<pre>moved into something like the undercloud installation as an optional</pre>
<pre>action as part of the deployment itself. It's not exactly without</pre>
<pre>merit in this case.</pre>
<pre><br></pre>
<pre>I don't really care one way or another for this action, however I</pre>
<pre>don't think it's as simple as saying "oh it's just a few lines of code</pre>
<pre>so we shouldn't..."</pre>
</blockquote>
<div><br>
</div>
<div>What it sounds like is that there's a need for documented guidelines. A lot of changes have been made as part of a learning process and we now know a lot more about what tasks are better suited to be done directly in the client vs via ansible roles vs
 via ansible modules. If we can document these best practises then we can guide any new changes according to them.</div>
<div><br>
</div>
<div>It seems to me that we need to consider:</div>
<div><br>
</div>
<div>1. Requirements - what needs to get done</div>
<div>2. Constraints - does the action need something special like access to devices or kernel API's</div>
<div>3. Testability - something in python or an ansible module is unit testable, whereas an ansible role is more difficult to properly test</div>
<div>4. Scalability - complex ansible tasks/vars  scale far worse that ansible modules</div>
<div>5. Maintainability - many factors are involved here, but sometimes efficiency should be sacrificed for simplicity</div>
<div><br>
</div>
</body>
</html>