bbinet / pillarstack

Custom saltstack ext_pillar heavily based on jinja2 for maximum flexibility
MIT License
59 stars 15 forks source link

Add salt SerializerExtension for yaml filter, etc. #27

Closed sbreidba closed 7 years ago

sbreidba commented 7 years ago

The SerializerExtension class in salt.utils.jinja lets us (among other things) take an entire dictionary and render it to YAML. For example: {{ some_dict | yaml }}.

bbinet commented 7 years ago

Thanks. For my information, can you explain what does the 900a7f commit is doing?

sbreidba commented 7 years ago

Certainly. By default the loader will only process a subset of types, and a unicode string isn't one of them. For what it's worth I took the strategy/code from here: https://github.com/saltstack/salt/blob/develop/salt/utils/yamlloader.py (see __init__). That said, I wasn't thrilled with copying code, but couldn't find a clean way to use the SaltYamlSafeLoader defined in saltstack.

bbinet commented 7 years ago

Thanks for your explanation.

sbreidba commented 7 years ago

No, thank you for a super-valuable extension to the pillar system. It just saved my bacon.