loop with var name

This showcases you can use a var name to refer to a list to iterate through

Also, the ref var name could be dynamic

Demo

source

Main task yaml file
    vars:
      items:
      - item1
      - item2
      - item3
      loopkey: items
    tasks:
    - name: task
      task:
      - func: cmd
        desc: demo varname to ref to a loop item from var
        do:
        - name: print
          cmd: '{{.loopitem}}'
        loop: items
      - func: cmd
        desc: demo use dynamic key to ref to a loop item from var
        do:
        - name: print
          cmd: '{{.loopitem}}'
        loop: '{{.loopkey}}'
    
Main log file
    loading [Config]:  ./tests/functests/upconfig.yml
    Main config:
                 Version -> 1.0.0
                  RefDir -> ./tests/functests
                 WorkDir -> cwd
              AbsWorkDir -> /up_project/up
                TaskFile -> c0167
                 Verbose -> vvv
              ModuleName -> self
               ShellType -> /bin/sh
           MaxCallLayers -> 8
                 Timeout -> 3600000
     MaxModuelCallLayers -> 256
               EntryTask -> task
      ModRepoUsernameRef -> 
      ModRepoPasswordRef -> 
    work dir: /up_project/up
    -exec task: task
    loading [Task]:  ./tests/functests/c0167
    module: [self], instance id: [dev], exec profile: []
    profile -  envVars:
    
    (*core.Cache)({
    })
    
    Task1: [task ==> task:  ]
    -Step1: [: demo varname to ref to a loop item from var ]
    self: final context exec vars:
    
    (*core.Cache)({
      "loopkey": "items",
      "items": {
        "item1",
        "item2",
        "item3"
      },
      "up_runtime_task_layer_number": 0
    })
    
    ~SubStep1: [print:  ]
    item1
    ~SubStep1: [print:  ]
    item2
    ~SubStep1: [print:  ]
    item3
    -Step2: [: demo use dynamic key to ref to a loop item from var ]
    self: final context exec vars:
    
    (*core.Cache)({
      "loopkey": "items",
      "items": {
        "item1",
        "item2",
        "item3"
      },
      "up_runtime_task_layer_number": 0
    })
    
    ~SubStep1: [print:  ]
    item1
    ~SubStep1: [print:  ]
    item2
    ~SubStep1: [print:  ]
    item3
    
Logs with different verbose level
Raw logs with different verbose level