Hello, I have a task that loops to get user details in one same server. The exceededCPUUsers contains the
list of the users.
For example:
exceededCPUUsers: [user1, user2]
This is the task in a workflow:
Task3:
action: core.remote
with: <% ctx().exceededCPUUsers %>
input:
username: root
hosts: "{{ ctx().hostname }}"
cmd: "checkpkg user={{ item() }}"
next:
- when: <% succeeded() %>
publish:
- getPackage: <% task(Task3).result %>
It saves the output to getPackage like this : https://pastebin.com/Vm7R34ag
I’m struggling with the list inside list part (items list and hostname list) .I need suggestion on how to make the output like this: https://pastebin.com/3ZdcRF4i
As you can see the hostname list is merged, and the item() from exceededCPUUsers become keys. I think it’s like changing from nested list into dict inside list.
I really appreciate the help.