retrieve secret from valut

When you put senstive information into vault, you can use a template func to retrieve it and use it in template rendering

This example shows that you can not get the secret value in general cache, unless you use fromVault template func

Demo

source

Main task yaml file
    tasks:
    - name: task
      task:
      - func: cmd
        dvars:
        - name: my_secret
          value: you_will_never_know
          flags:
          - secret
        do:
        - name: print
          cmd: |-
            hello, this is a secrt value: {{.my_secret}}
            hello, this is a secrt value: {{ "my_secret" | fromVault}}
            hello, this is a secrt value: {{ "a_secret_does_not_exist_in_vault" | fromVault}}
    
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 -> c0204
                 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/c0204
    module: [self], instance id: [dev], exec profile: []
    profile -  envVars:
    
    (*core.Cache)({
    })
    
    Task1: [task ==> task:  ]
    -Step1:
    self: final context exec vars:
    
    (*core.Cache)({
      "up_runtime_task_layer_number": 0
    })
    
    ~SubStep1: [print:  ]
    hello, this is a secrt value: <no value>
    hello, this is a secrt value: you_will_never_know
    hello, this is a secrt value: NotExistInVault
    
Logs with different verbose level
Raw logs with different verbose level