Created
March 18, 2021 14:25
-
-
Save hemebond/7961da299ac3fd17e168d1666d411a54 to your computer and use it in GitHub Desktop.
Using Grains cache in pillars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{%- set grns = salt.saltutil.runner('cache.grains', tgt='serv*') %} | |
{%- for id, grn in grns.items()|sort %} | |
{%- set role = id[3:6] %} | |
address: {{ grn.ip4_interfaces.eth0[0] | default("127.0.0.1") }} | |
{%- endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment