Skip to content

Instantly share code, notes, and snippets.

View tacerus's full-sized avatar
💭
Loading kernel ...

Georg tacerus

💭
Loading kernel ...
View GitHub Profile
@hemebond
hemebond / p.yaml
Created March 18, 2021 14:25
Using Grains cache in pillars
{%- 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 %}
@hemebond
hemebond / salt_python_renderer_example1.py
Created March 27, 2017 11:00
Render a YAML file using the Saltstack Python renderer
#!py
# test.sls
import yaml
def run():
config = {}
map_file = __salt__.cp.cache_file("salt://formula/map.yaml")