Skip to content

Instantly share code, notes, and snippets.

@wwalker
Last active November 9, 2022 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwalker/39e1f6437c3b9f17bf15d23cf5564dc7 to your computer and use it in GitHub Desktop.
Save wwalker/39e1f6437c3b9f17bf15d23cf5564dc7 to your computer and use it in GitHub Desktop.
dynamic host inventory generation
---
masters:
hosts:
es-master-{{ cluster_name }}-00{1..{{ master.count }}}: {}
hot-nodes:
hosts:
es-hot-{{ cluster_name }}-00{1..{{ hot.count }}}: {}
warm-nodes:
hosts:
es-warm-{{ cluster_name }}-00{1..{{ warm.count }}}: {}
coord-nodes:
hosts:
es-coord-{{ cluster_name }}-00{1..{{ coord.count }}}: {}
@wwalker
Copy link
Author

wwalker commented Nov 9, 2022

I want to do something like inventory.yml and have it generate the list of hosts.

Is there a shortcut, or should I just use jinja2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment