Skip to content

Instantly share code, notes, and snippets.

@matthewcosgrove
Last active February 4, 2021 09:15
Show Gist options
  • Save matthewcosgrove/6cdee88fb804150ef2708e015b6bbc96 to your computer and use it in GitHub Desktop.
Save matthewcosgrove/6cdee88fb804150ef2708e015b6bbc96 to your computer and use it in GitHub Desktop.
For ytt playground
#@ load("@ytt:data", "data")
#@ load("@ytt:template", "template")
#@ def parse(deployment):
#@ key = "{}".format(deployment.ip)
#@ return {key: {"idrac_ip": "{{ inventory_hostname }}","catalog_xml": deployment.catalogXml}}
#@ end
all:
hosts:
#@ for deployment in data.values.deployments:
_: #@ template.replace(parse(deployment))
#@ end
#@data/values
---
deployments:
- ip: 10.0.0.1
catalogXml: "Catalog1.xml"
- ip: 10.0.0.2
catalogXml: "Catalog2.xml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment