github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/tests/functests/c0204.yml (about)

     1  doc_meta: |
     2    folder: security
     3    title: retrieve secret from valut
     4    head: |
     5      When you put senstive information into vault, you can use a template func to retrieve it and use it in template rendering
     6  
     7      This example shows that you can not get the secret value in general cache, unless you use fromVault template func
     8  
     9    sections:
    10      - title: Demo
    11        log: yes
    12  
    13  tasks:
    14    -
    15      name: task
    16      task:
    17        -
    18          func: cmd
    19          dvars:
    20            - name: my_secret
    21              value: you_will_never_know
    22              flags:
    23                - secret
    24  
    25          do:
    26            - name: print
    27              cmd: |
    28                hello, this is a secrt value: {{.my_secret}}
    29                hello, this is a secrt value: {{ "my_secret" | fromVault}}
    30                hello, this is a secrt value: {{ "a_secret_does_not_exist_in_vault" | fromVault}}