Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-21 Thread Renat Akhmerov

> On 20 Oct 2015, at 14:58, WANG, Ming Hao (Tony T) 
>  wrote:
> 
> Another question is:
> If I use custom action to run Ansible, the Ansible playbook should be stored 
> on the same server of Mistral. Is it right?

Depends on how this action is implemented (it can, for example, do ssh to other 
servers) but the simplest implementation would be with playbooks on the same 
server, yes.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-21 Thread Renat Akhmerov

> On 19 Oct 2015, at 13:18, WANG, Ming Hao (Tony T) 
>  wrote:
> 
> I like your 
> option2(https://blueprints.launchpad.net/mistral/+spec/action-providers 
> ). J
> Any schedule for this? Looks like it isn’t started yet.

No particular plans yet. It’s been around for several months by now. It could 
be included in Mitaka as long as our resources allows to do that.__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-21 Thread WANG, Ming Hao (Tony T)
Renat,

Thanks for your valuable suggestions!

Tony

From: Renat Akhmerov [mailto:rakhme...@mirantis.com]
Sent: Wednesday, October 21, 2015 2:35 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral


On 20 Oct 2015, at 14:58, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:

Another question is:
If I use custom action to run Ansible, the Ansible playbook should be stored on 
the same server of Mistral. Is it right?

Depends on how this action is implemented (it can, for example, do ssh to other 
servers) but the simplest implementation would be with playbooks on the same 
server, yes.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-20 Thread WANG, Ming Hao (Tony T)
Renat,

Another question is:
If I use custom action to run Ansible, the Ansible playbook should be stored on 
the same server of Mistral. Is it right?

Thanks,
Tony

From: Renat Akhmerov [mailto:rakhme...@mirantis.com]
Sent: Monday, October 19, 2015 2:58 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral


On 19 Oct 2015, at 07:53, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:

The “custom action” needs to re-install Mistral.
If the Mistral service is part of 3rd party OpenStack, it may be unacceptable 
to let every user create his own customer action. What do you think?

Yes, correct. It requires reinstall. If your goal is to give users possibility 
to create custom actions "on the fly” then it’s now impossible in Mistral for 
fundamental reasons. We can’t let users upload arbitrary Python code via API 
for security reasons. However, we have a couple of ideas that we’re going to 
explore in order to partially close this gap:

  *   Keep action code on a client-side, sort of what StackStorm does. But IMO 
we could think about automating it in a more elegant and transparent way. For 
example, we could use decorators in python code that would associate a function 
or a class with a certain workflow task. Then a workflow could call this code 
back while its running using some mechanism (i.e. some special action). In this 
case, however, we’d have to have a process handling callback requests from 
Mistral on a client side. The alternative: using HTTP Long Poll mechanism so 
that a client could claim available tasks itself.
  *   We have BP [1] that describes the idea of using so-called action 
providers. It assumes that we can register trustworthy action providers that 
could dynamically provide new actions to Mistral. I personally like this idea 
and to some extent it would solve this issue but it requires some additional 
setup which works for cases like StackStorm but doesn’t work if we want to use 
Mistral as is, as a hosted workflow service.

Anyway, whatever solution we accept it will be a trade-off and depend on a 
particular use case.

Ad-hoc actions may also work for you if, for example, we create enough base 
actions that they could be built upon. Say if most of your actions are HTTP 
based then you can just create your own library (e.g. a workbook) of ad-hoc 
actions that will be wrappers around std.http.

Also look at what StackStorm does, it may also be helpful.

Thanks

[1] https://blueprints.launchpad.net/mistral/+spec/action-providers
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-20 Thread Lingxian Kong
Hi, Minghao,

The answer is yes, if you want to use Ansible playbook in you
customized 'ansible actions', you need put the playbooks under a place
that your code has access to.

BTW, you can send personal email to me in Chinese, in case you want to
solve your problems quickly :-)

On Tue, Oct 20, 2015 at 4:58 PM, WANG, Ming Hao (Tony T)
<tony.a.w...@alcatel-lucent.com> wrote:
> Renat,
>
>
>
> Another question is:
>
> If I use custom action to run Ansible, the Ansible playbook should be stored
> on the same server of Mistral. Is it right?
>
>
>
> Thanks,
>
> Tony
>
>
>
> From: Renat Akhmerov [mailto:rakhme...@mirantis.com]
> Sent: Monday, October 19, 2015 2:58 PM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as
> Ansible) in Mistral
>
>
>
>
>
> On 19 Oct 2015, at 07:53, WANG, Ming Hao (Tony T)
> <tony.a.w...@alcatel-lucent.com> wrote:
>
>
>
> The “custom action” needs to re-install Mistral.
>
> If the Mistral service is part of 3rd party OpenStack, it may be
> unacceptable to let every user create his own customer action. What do you
> think?
>
>
>
> Yes, correct. It requires reinstall. If your goal is to give users
> possibility to create custom actions "on the fly” then it’s now impossible
> in Mistral for fundamental reasons. We can’t let users upload arbitrary
> Python code via API for security reasons. However, we have a couple of ideas
> that we’re going to explore in order to partially close this gap:
>
> Keep action code on a client-side, sort of what StackStorm does. But IMO we
> could think about automating it in a more elegant and transparent way. For
> example, we could use decorators in python code that would associate a
> function or a class with a certain workflow task. Then a workflow could call
> this code back while its running using some mechanism (i.e. some special
> action). In this case, however, we’d have to have a process handling
> callback requests from Mistral on a client side. The alternative: using HTTP
> Long Poll mechanism so that a client could claim available tasks itself.
> We have BP [1] that describes the idea of using so-called action providers.
> It assumes that we can register trustworthy action providers that could
> dynamically provide new actions to Mistral. I personally like this idea and
> to some extent it would solve this issue but it requires some additional
> setup which works for cases like StackStorm but doesn’t work if we want to
> use Mistral as is, as a hosted workflow service.
>
>
>
> Anyway, whatever solution we accept it will be a trade-off and depend on a
> particular use case.
>
>
>
> Ad-hoc actions may also work for you if, for example, we create enough base
> actions that they could be built upon. Say if most of your actions are HTTP
> based then you can just create your own library (e.g. a workbook) of ad-hoc
> actions that will be wrappers around std.http.
>
>
>
> Also look at what StackStorm does, it may also be helpful.
>
>
>
> Thanks
>
>
>
> [1] https://blueprints.launchpad.net/mistral/+spec/action-providers
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Regards!
---
Lingxian Kong

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-20 Thread Lingxian Kong
Or, feel free to join our IRC channel for quick response, #openstack-mistral

On Tue, Oct 20, 2015 at 4:58 PM, WANG, Ming Hao (Tony T)
<tony.a.w...@alcatel-lucent.com> wrote:
> Renat,
>
>
>
> Another question is:
>
> If I use custom action to run Ansible, the Ansible playbook should be stored
> on the same server of Mistral. Is it right?
>
>
>
> Thanks,
>
> Tony
>
>
>
> From: Renat Akhmerov [mailto:rakhme...@mirantis.com]
> Sent: Monday, October 19, 2015 2:58 PM
> To: OpenStack Development Mailing List (not for usage questions)
> Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as
> Ansible) in Mistral
>
>
>
>
>
> On 19 Oct 2015, at 07:53, WANG, Ming Hao (Tony T)
> <tony.a.w...@alcatel-lucent.com> wrote:
>
>
>
> The “custom action” needs to re-install Mistral.
>
> If the Mistral service is part of 3rd party OpenStack, it may be
> unacceptable to let every user create his own customer action. What do you
> think?
>
>
>
> Yes, correct. It requires reinstall. If your goal is to give users
> possibility to create custom actions "on the fly” then it’s now impossible
> in Mistral for fundamental reasons. We can’t let users upload arbitrary
> Python code via API for security reasons. However, we have a couple of ideas
> that we’re going to explore in order to partially close this gap:
>
> Keep action code on a client-side, sort of what StackStorm does. But IMO we
> could think about automating it in a more elegant and transparent way. For
> example, we could use decorators in python code that would associate a
> function or a class with a certain workflow task. Then a workflow could call
> this code back while its running using some mechanism (i.e. some special
> action). In this case, however, we’d have to have a process handling
> callback requests from Mistral on a client side. The alternative: using HTTP
> Long Poll mechanism so that a client could claim available tasks itself.
> We have BP [1] that describes the idea of using so-called action providers.
> It assumes that we can register trustworthy action providers that could
> dynamically provide new actions to Mistral. I personally like this idea and
> to some extent it would solve this issue but it requires some additional
> setup which works for cases like StackStorm but doesn’t work if we want to
> use Mistral as is, as a hosted workflow service.
>
>
>
> Anyway, whatever solution we accept it will be a trade-off and depend on a
> particular use case.
>
>
>
> Ad-hoc actions may also work for you if, for example, we create enough base
> actions that they could be built upon. Say if most of your actions are HTTP
> based then you can just create your own library (e.g. a workbook) of ad-hoc
> actions that will be wrappers around std.http.
>
>
>
> Also look at what StackStorm does, it may also be helpful.
>
>
>
> Thanks
>
>
>
> [1] https://blueprints.launchpad.net/mistral/+spec/action-providers
>
>
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Regards!
---
Lingxian Kong

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-19 Thread Renat Akhmerov

> On 19 Oct 2015, at 07:53, WANG, Ming Hao (Tony T) 
>  wrote:
> 
> The “custom action” needs to re-install Mistral.
> If the Mistral service is part of 3rd party OpenStack, it may be unacceptable 
> to let every user create his own customer action. What do you think?

Yes, correct. It requires reinstall. If your goal is to give users possibility 
to create custom actions "on the fly” then it’s now impossible in Mistral for 
fundamental reasons. We can’t let users upload arbitrary Python code via API 
for security reasons. However, we have a couple of ideas that we’re going to 
explore in order to partially close this gap:
Keep action code on a client-side, sort of what StackStorm does. But IMO we 
could think about automating it in a more elegant and transparent way. For 
example, we could use decorators in python code that would associate a function 
or a class with a certain workflow task. Then a workflow could call this code 
back while its running using some mechanism (i.e. some special action). In this 
case, however, we’d have to have a process handling callback requests from 
Mistral on a client side. The alternative: using HTTP Long Poll mechanism so 
that a client could claim available tasks itself.
We have BP [1] that describes the idea of using so-called action providers. It 
assumes that we can register trustworthy action providers that could 
dynamically provide new actions to Mistral. I personally like this idea and to 
some extent it would solve this issue but it requires some additional setup 
which works for cases like StackStorm but doesn’t work if we want to use 
Mistral as is, as a hosted workflow service.

Anyway, whatever solution we accept it will be a trade-off and depend on a 
particular use case.

Ad-hoc actions may also work for you if, for example, we create enough base 
actions that they could be built upon. Say if most of your actions are HTTP 
based then you can just create your own library (e.g. a workbook) of ad-hoc 
actions that will be wrappers around std.http.

Also look at what StackStorm does, it may also be helpful.

Thanks

[1] https://blueprints.launchpad.net/mistral/+spec/action-providers 
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-19 Thread WANG, Ming Hao (Tony T)
Renat,

Thanks for your info.
I like your 
option2(https://blueprints.launchpad.net/mistral/+spec/action-providers). ☺
Any schedule for this? Looks like it isn’t started yet.

Thanks,
Tony

From: Renat Akhmerov [mailto:rakhme...@mirantis.com]
Sent: Monday, October 19, 2015 2:58 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral


On 19 Oct 2015, at 07:53, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:

The “custom action” needs to re-install Mistral.
If the Mistral service is part of 3rd party OpenStack, it may be unacceptable 
to let every user create his own customer action. What do you think?

Yes, correct. It requires reinstall. If your goal is to give users possibility 
to create custom actions "on the fly” then it’s now impossible in Mistral for 
fundamental reasons. We can’t let users upload arbitrary Python code via API 
for security reasons. However, we have a couple of ideas that we’re going to 
explore in order to partially close this gap:

  *   Keep action code on a client-side, sort of what StackStorm does. But IMO 
we could think about automating it in a more elegant and transparent way. For 
example, we could use decorators in python code that would associate a function 
or a class with a certain workflow task. Then a workflow could call this code 
back while its running using some mechanism (i.e. some special action). In this 
case, however, we’d have to have a process handling callback requests from 
Mistral on a client side. The alternative: using HTTP Long Poll mechanism so 
that a client could claim available tasks itself.
  *   We have BP [1] that describes the idea of using so-called action 
providers. It assumes that we can register trustworthy action providers that 
could dynamically provide new actions to Mistral. I personally like this idea 
and to some extent it would solve this issue but it requires some additional 
setup which works for cases like StackStorm but doesn’t work if we want to use 
Mistral as is, as a hosted workflow service.

Anyway, whatever solution we accept it will be a trade-off and depend on a 
particular use case.

Ad-hoc actions may also work for you if, for example, we create enough base 
actions that they could be built upon. Say if most of your actions are HTTP 
based then you can just create your own library (e.g. a workbook) of ad-hoc 
actions that will be wrappers around std.http.

Also look at what StackStorm does, it may also be helpful.

Thanks

[1] https://blueprints.launchpad.net/mistral/+spec/action-providers
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-19 Thread WANG, Ming Hao (Tony T)
Dmitri,

>From StackStorm's document, it can run Mistral's workflow, and Mistral 
>workflow can call StackStorm custom actions.
Could you please help to explain how it is implemented?

examples.mistral-basic:
description: A basic workflow that runs an arbitrary linux command.
type: direct
input:
- cmd
output:
stdout: <% $.stdout %>
tasks:
task1:
action: core.local cmd=<% $.cmd %> <<<< Here calls StackStorm 
custom action.
publish:
stdout: <% $.task1.stdout %>
stderr: <% $.task1.stderr %>

Thanks,
Tony


From: Dmitri Zimine [mailto:dzim...@stackstorm.com]
Sent: Sunday, October 18, 2015 1:27 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral

Tony,

You can also connect Mistral with Ansible via StackStorm and Ansible 
integration pack:
1) StackStorm http://docs.stackstorm.com
2) https://github.com/StackStorm/st2contrib/tree/master/packs/ansible

StackStorm is open-source Apache 2.0 "wrapper" around Mistral workflow service 
that integrates 3rd party tools.

Disclosure: I work for StackStorm, I think it's appropriate to pitch here an 
open source project that addresses the problem.

DZ.


On Oct 15, 2015, at 11:35 PM, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:


Dear Mistral developers and testers,

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.
Could you please help to provide how to let Mistral call Ansible playbook or 
Ansible module?
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.

Another question is:
If we install Mistral and Ansible on a same server, is it possible to simplify 
it?

Thanks in advance,
Tony

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: 
openstack-dev-requ...@lists.openstack.org<mailto:openstack-dev-requ...@lists.openstack.org>?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-19 Thread WANG, Ming Hao (Tony T)
Dmitri,

I think I got it.

"st2/st2common/st2common/util/workflow/mistral.py"
StackStorm uses function "_transform_action" here to transform action from 
StackStorm action style to "st2.action" style, and then call Mistral to execute 
workflow, since "st2.action" is Mistral's custom action.
Please help to double confirm.

Thanks,
Tony

From: WANG, Ming Hao (Tony T)
Sent: Monday, October 19, 2015 6:56 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: RE: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral

Dmitri,

>From StackStorm's document, it can run Mistral's workflow, and Mistral 
>workflow can call StackStorm custom actions.
Could you please help to explain how it is implemented?

examples.mistral-basic:
description: A basic workflow that runs an arbitrary linux command.
type: direct
input:
- cmd
output:
stdout: <% $.stdout %>
tasks:
task1:
action: core.local cmd=<% $.cmd %> <<<< Here calls StackStorm 
custom action.
publish:
stdout: <% $.task1.stdout %>
stderr: <% $.task1.stderr %>

Thanks,
Tony


From: Dmitri Zimine [mailto:dzim...@stackstorm.com]
Sent: Sunday, October 18, 2015 1:27 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral

Tony,

You can also connect Mistral with Ansible via StackStorm and Ansible 
integration pack:
1) StackStorm http://docs.stackstorm.com
2) https://github.com/StackStorm/st2contrib/tree/master/packs/ansible

StackStorm is open-source Apache 2.0 "wrapper" around Mistral workflow service 
that integrates 3rd party tools.

Disclosure: I work for StackStorm, I think it's appropriate to pitch here an 
open source project that addresses the problem.

DZ.


On Oct 15, 2015, at 11:35 PM, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:

Dear Mistral developers and testers,

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.
Could you please help to provide how to let Mistral call Ansible playbook or 
Ansible module?
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.

Another question is:
If we install Mistral and Ansible on a same server, is it possible to simplify 
it?

Thanks in advance,
Tony

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: 
openstack-dev-requ...@lists.openstack.org<mailto:openstack-dev-requ...@lists.openstack.org>?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-18 Thread WANG, Ming Hao (Tony T)
Renat,

Thanks for your valuable comments. ☺
The “custom action” needs to re-install Mistral.
If the Mistral service is part of 3rd party OpenStack, it may be unacceptable 
to let every user create his own customer action. What do you think?

Thanks,
Tony


From: Renat Akhmerov [mailto:rakhme...@mirantis.com]
Sent: Saturday, October 17, 2015 3:25 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral

Hi, see my answers inline.

On 16 Oct 2015, at 12:35, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:

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.
Could you please help to provide how to let Mistral call Ansible playbook or 
Ansible module?

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.


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.

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.

Anyway, it’s just my preference. You may like this second option better.


Another question is:
If we install Mistral and Ansible on a same server, is it possible to simplify 
it?

Yes, like I described above.

[1] 
http://docs.openstack.org/developer/mistral/developer/creating_custom_action.html


Renat Akhmerov
@ Mirantis Inc.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-18 Thread WANG, Ming Hao (Tony T)
Dmitri,

Thanks for your valuable info. :)
I suppose  the flow here should be:
Mistral calls StackStorm, and StackStorm calls Ansible. Is it right?
The big benefit here should be we only need to install StackStorm custom action 
into Mistral, and StackStorm will handle all the interfaces to other automation 
tools, such as Ansible. Is it right?

Thanks,
Tony

From: Dmitri Zimine [mailto:dzim...@stackstorm.com]
Sent: Sunday, October 18, 2015 1:27 AM
To: OpenStack Development Mailing List (not for usage questions)
Subject: Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as 
Ansible) in Mistral

Tony,

You can also connect Mistral with Ansible via StackStorm and Ansible 
integration pack:
1) StackStorm http://docs.stackstorm.com
2) https://github.com/StackStorm/st2contrib/tree/master/packs/ansible

StackStorm is open-source Apache 2.0 "wrapper" around Mistral workflow service 
that integrates 3rd party tools.

Disclosure: I work for StackStorm, I think it's appropriate to pitch here an 
open source project that addresses the problem.

DZ.


On Oct 15, 2015, at 11:35 PM, WANG, Ming Hao (Tony T) 
<tony.a.w...@alcatel-lucent.com<mailto:tony.a.w...@alcatel-lucent.com>> wrote:


Dear Mistral developers and testers,

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.
Could you please help to provide how to let Mistral call Ansible playbook or 
Ansible module?
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.

Another question is:
If we install Mistral and Ansible on a same server, is it possible to simplify 
it?

Thanks in advance,
Tony

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: 
openstack-dev-requ...@lists.openstack.org<mailto:openstack-dev-requ...@lists.openstack.org>?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-17 Thread Dmitri Zimine
Tony, 

You can also connect Mistral with Ansible via StackStorm and Ansible 
integration pack: 
1) StackStorm http://docs.stackstorm.com
2) https://github.com/StackStorm/st2contrib/tree/master/packs/ansible

StackStorm is open-source Apache 2.0 “wrapper” around Mistral workflow service 
that integrates 3rd party tools.

Disclosure: I work for StackStorm, I think it’s appropriate to pitch here an 
open source project that addresses the problem.

DZ.


On Oct 15, 2015, at 11:35 PM, WANG, Ming Hao (Tony T) 
 wrote:

> Dear Mistral developers and testers,
>  
> 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.
> Could you please help to provide how to let Mistral call Ansible playbook or 
> Ansible module?
> 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.
>  
> Another question is:
> If we install Mistral and Ansible on a same server, is it possible to 
> simplify it?
>  
> Thanks in advance,
> Tony
>  
> __
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-16 Thread Renat Akhmerov
Hi, see my answers inline.

> On 16 Oct 2015, at 12:35, WANG, Ming Hao (Tony T) 
>  wrote:
> 
> 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.
> Could you please help to provide how to let Mistral call Ansible playbook or 
> Ansible module?

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.

> 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.

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.

Anyway, it’s just my preference. You may like this second option better.

> Another question is:
> If we install Mistral and Ansible on a same server, is it possible to 
> simplify it?

Yes, like I described above.

[1] 
http://docs.openstack.org/developer/mistral/developer/creating_custom_action.html
 



Renat Akhmerov
@ Mirantis Inc.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-16 Thread Renat Akhmerov

> On 16 Oct 2015, at 13:02, WANG, Ming Hao (Tony T) 
>  wrote:
> 
> Another question is:
> If I want to call a user-defined script in Mistral, what action should be 
> used?
> Still use “ssh std_action”?


Yes, std.ssh action or std.ssh_proxied that allows to ssh through an VM with a 
floating ip (ssh gateway) to other VMs. “std.ssh_proxied” was just added 
recently.

Renat Akhmerov
@ Mirantis Inc.

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-16 Thread WANG, Ming Hao (Tony T)
Dear Mistral developers and testers,

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.
Could you please help to provide how to let Mistral call Ansible playbook or 
Ansible module?
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.

Another question is:
If we install Mistral and Ansible on a same server, is it possible to simplify 
it?

Thanks in advance,
Tony

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) in Mistral

2015-10-16 Thread WANG, Ming Hao (Tony T)
Another question is:
If I want to call a user-defined script in Mistral, what action should be used?
Still use "ssh std_action"?

Thanks in advance,
Tony

From: WANG, Ming Hao (Tony T) [mailto:tony.a.w...@alcatel-lucent.com]
Sent: Friday, October 16, 2015 2:36 PM
To: OpenStack Development Mailing List (not for usage questions)
Subject: [openstack-dev] [mistral] How to call 3rd-party tools(such as Ansible) 
in Mistral

Dear Mistral developers and testers,

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.
Could you please help to provide how to let Mistral call Ansible playbook or 
Ansible module?
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.

Another question is:
If we install Mistral and Ansible on a same server, is it possible to simplify 
it?

Thanks in advance,
Tony

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev