Skip to content

Instantly share code, notes, and snippets.

@dnmgns
Last active December 14, 2020 11:48
Show Gist options
  • Save dnmgns/e6620c050c3b6fe9a445d66fb3c034dc to your computer and use it in GitHub Desktop.
Save dnmgns/e6620c050c3b6fe9a445d66fb3c034dc to your computer and use it in GitHub Desktop.
ytt data value into multiline string
#@data/values
---
user: 'johndoe'
startup:
user.sh: |
/opt/user.sh --user johndoe
#@ load("@ytt:yaml", "yaml")
#@ load("@ytt:data", "data")
#@ def user():
---
#@ "/opt/user.sh --user " + data.values.user
---
#@ end
---
startup:
user.sh: #@ yaml.encode(user())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment