Dynamic hostlist create new task for each item

Hello ,

My goal is to create dynamic workflow tasks. I have a CMDB and my first task is to get all servers in prod after that my 2nd task is a for loop to iterate over those hosts.

Any idea how to create a new workflow task for each server in the list. The idea here is to have 20 tor 25 tasks based on which servers are in prod. My goal is to have a new task for each host to be sure that i have good output based on every server not 1 big workflow with 20 servers output and to search which fails and which not.

We didn’t that on jenkins and its working perfectly but I want to migrate it to stackstorm.

Just to mention that im using Mistral because we are with 2.9 ST2 and im not sure when we will upgrade to 3.2. The problem i hit is with Orchestra for loop bug Orquesta - Unable to use loop variable in a Jinja for loop · Issue #4701 · StackStorm/st2 · GitHub

All that will be scheduled in st2 cron. The current workaround is to create manual rules for each host and scheduled them with st2cron but i want to use the CMDB to avoid babysitting in the feature no matter if we remove or add new hosts this automation will work.

Hi @eazysnatch. I’d highly recommend considering upgrading ST2. We are in the process of removing Mistral from ST2.