ake-persson / pepa Goto Github PK
View Code? Open in Web Editor NEWConfiguration templating for SaltStack using Hierarchical substitution and Jinja.
License: Other
Configuration templating for SaltStack using Hierarchical substitution and Jinja.
License: Other
Add unit tests for each function.
Add support for getting Keys out of Etcd. This could be done by the Etcd ext. pillar but would be more limited since it can't be templated.
This looks like a very interesting approach to solving the hierarchical override problem. Can it be combined with pillar data that is stored in a VCS repo and mounted via gitfs or hgfs? For example, is it possible to store all of the pepa templates in git and then apply the overrides on the master using the pepa ext pillar?
Cleanup output validation script, improve/simplify how it tests.
Add support for Merge and Immutable as in Distill. Useful to merge key/value across templates and immutable can be used to make sure a key/value pair won't be overwritten.
If the string for a key is repeated, key_value_to_tree() produces strange results, up to and including exceptions:
In [1]: import collections
In [2]: import pepa
In [3]: data = collections.OrderedDict([('foo..bar..foo', True), ('foo..bar..baz', True)])
In [4]: pepa.key_value_to_tree(data, '..')
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-f64c7011dc9a> in <module>()
----> 1 pepa.key_value_to_tree(data, '..')
/mnt/c/Users/bewing/PycharmProjects/pepa/pepa/__init__.pyc in key_value_to_tree(data, delimiter)
28 t[key] = value
29 else:
---> 30 t = t.setdefault(key, {})
31 return tree
32
AttributeError: 'bool' object has no attribute 'setdefault'
In order to avoid this, we will probably have to track the number of times a key appears in the hierarchy, and only set once we really are on the last key.
Pepa looks like the right tool I need to manage my salt pillar, but I have a hard time to fully understand how it work. So a walkthrough/tutorial similar to http://docs.saltstack.com/en/latest/topics/tutorials/pillar.html will be really helpful.
The questions I have:
Thanks!
An issue has been raised with Gittle: FriendCode/gittle#22
In Hiera it's possible to specify the configuration in a hierarchy of directories on the file system, like so:
common.yaml
locations/dc1/common.yaml
locations/dc1/hosts/hosta.yaml
locations/dc1/hosts/hostb.yaml
locations/dc2/common.yaml
locations/dc2/hosts/hostc.yaml
locations/dc2/hosts/hostd.yaml
So far in pepa the closest I can arrive at is:
default/default.yaml
locations/dc1.yaml
locations/dc2.yaml
hosts/hosta.yaml
hosts/hostb.yaml
hosts/hostc.yaml
hosts/hostd.yaml
However, it's not immediately obvious from the layout what location a given host belongs to. This gets more complex when you have a lot of hosts and more steps in the sequence (environments etc.)
Is a similar approach to the first example possible with pepa or is there another, pepa specific, way to handle this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.