StackStorm rule..

71 views
Skip to first unread message

Arun Somashekar

unread,
Nov 11, 2016, 6:26:20 PM11/11/16
to Google Group Messages, Support, Dmitri Zimine, DL-Stackstorm-Support, StackStorm

Hi,

can u let me know how to make the rule execute a workflow instead of only action..

I have a workflow(ping1.yaml) inside which it calls atask-  python action (walkthrough.smple & a simple  ping task).... and also in the rule-  reule-ref is
walthrough.ref...

When I run the polling sensor, it will execute only the walkthrough.smple and not ping task.. i.e not executing workflow only action..


I am pasting the snippet of the code here..

##############Workflow- action############

root:/opt/stackstorm/packs/walkthrough/actions# cat ping1.yaml
name: ping1
pack: walkthrough
description: Simple ping based diagnostic with Mistral.
runner_type: mistral-v2
entry_point: workflows/ping1.yaml



##############workflow##################
walkthrough.ping1:
   description: st2 walkthrough.ping1
#    input:
#        - host # This must match to action input.
   tasks:
       ping1_host:
          action: walkthrough.smple
           input:
             greeting: string
           on-success: append_stats

append_stats:
            action: core.local cmd="ping -c 1 216.58.197.69 >> /tmp/ping1.log"



##########python -Action--#################

walkthrough.ping1:
   description: st2 walkthrough.ping1
#    input:
#        - host # This must match to action input.
   tasks:
       ping1_host:
          action: walkthrough.smple
           input:
             greeting: string
           on-success: append_stats

==========Rule================= 
name: on_walkthrough_event1
pack: walkthrough
description: Sample rule firing on walkthrough.event1.
enabled: true
trigger:
   type: walkthrough.event1
action:
   ref: walkthrough.smple


everytime..  rule only triggers the action... which is walktrough.smple but not walkthrough.ping1.yaml workflow(which has 2 actions)

Thanks in advance..
 

On Thu, Nov 10, 2016 at 7:57 AM, Arun Somashekar <arun...@gmail.com> wrote:
Hi Winson,

I was able to get the napalm integrated with Stackstorm... 
@tomaz: Thanks for the suggestion

Now I am getting the Sensor-rule-trigger-action flow working... 
but I am facing the issue where  the Action is not getting triggered... I have followed all the troubleshhoting steps..
Rule matched but action not getting fired... I am using the polling sensor to trigger an action. I am attaching the acript and the logs..

Independently i can run only the action successfully.. but will all sensor,rule,trigger.. action does not get executed..

I am not sure where the issue is..

On Tue, Nov 8, 2016 at 11:13 PM, Google Group Messages <google-group-fwd@stackstorm.com> wrote:
Winson Chan
Winson Chan
This depends on the use cases. I recommend starting this with defining a python action in StackStorm that uses NAPALM to perform an operation. Please review docs at https://docs.stackstorm.com/actions.html.


walthrough.smple

Google Group Messages

unread,
Nov 11, 2016, 6:54:08 PM11/11/16
to NURA, DL-Stackstorm-Support, Dmitri Zimine, StackStorm
Lindsay Hill
Lindsay Hill
Can you post your code on gist.github.com, and post a message in Slack? That will be faster for responses, and using gist.github will preserve formatting. Otherwise It's hard to see what each of the individual files you have are, what they contain, and the exact formatting

Arun Somashekar

unread,
Nov 11, 2016, 7:18:12 PM11/11/16
to Google Group Messages, DL-Stackstorm-Support, Dmitri Zimine, StackStorm
Hi Hill,

Thnks for the reply.. Yeah I have done the same.. pasted the code at gist


With regards,
Arun S
Reply all
Reply to author
Forward
0 new messages