<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi, see my answers inline.<br class=""><div apple-content-edited="true" class="">
<div class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class="">On 16 Oct 2015, at 12:35, WANG, Ming Hao (Tony T) <<a href="mailto:tony.a.wang@alcatel-lucent.com" class="">tony.a.wang@alcatel-lucent.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 11pt;" class="">We have developed some Ansible playbooks for operation automation, and we are investigating if we can change the automation engine from Ansible to Mistral since Mistral has powerful workflow control.</span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Could you please help to provide how to let Mistral call Ansible playbook or Ansible module?</div></div></div></blockquote><div><br class=""></div><div>I would recommend to write a custom action (not ad-hoc actions in DSL, they are pretty limited). You can just write a python class and make it available in Mistral workflow. It is pretty easy to do and described at [1]. In Python you’ll have more control on how to call ansible properly. If you have any specific questions on that you can join our IRC channel #openstack-mistral and talk to us there.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">My understanding is to use ssh std_action to let Mistral access Ansible server to call Ansible playbook/modules since Mistral ad-hoc action must base on an existing system action.</div></div></div></blockquote><div><br class=""></div><div>Yes, you can use std.ssh action but I guess it won’t be too convenient because you’ll have to deal with shell commands directly. Yes, ad-hoc actions can help you do it in a more elegant manner but they are pretty limited and allow to create only wrappers. With Python custom actions (it can be a class hierarchy, for example) you can do much more. For instance, you can expose individual ansible actions and transform their params in a form that better fits workflow DSL.</div><div><br class=""></div><div>Anyway, it’s just my preference. You may like this second option better.</div><br class=""><blockquote type="cite" class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Another question is:<o:p class=""></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">If we install Mistral and Ansible on a same server, is it possible to simplify it?<o:p class=""></o:p></div></div></blockquote><br class=""></div><div>Yes, like I described above.</div><div class=""><br class=""></div><div class="">[1] <a href="http://docs.openstack.org/developer/mistral/developer/creating_custom_action.html" class="">http://docs.openstack.org/developer/mistral/developer/creating_custom_action.html</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">Renat Akhmerov</div><div class="">@ Mirantis Inc.</div></div><div class=""><br class=""></div></body></html>