-
Notifications
You must be signed in to change notification settings - Fork 23
Add first custom Ansible filter #1800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2b46fa4
to
db23943
Compare
This is directly compatible with #1744 |
db23943
to
f65a848
Compare
efaf8ec
to
b8f6168
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I've missed something, but shouldn't the filter live in kayobe? There is already a test framework there too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any filters designed for Kayobe config would best live in Kayobe, so they can be used there, and in OpenStack Kayobe config etc.
I agree that this filter might also be useful in Kayobe upstream, though I don't think that would apply to all custom filters. The idea that started this in the first place was that @GavinHeff is writing a custom fact-gathering playbook and there's some very specific templating. A custom filter would be very useful for formating that data, but would be pretty useless upstream. The main reason I'm adding this is just so that we have a precedent for future filters that we would only care about downstream. The actual content of the filter isn't really the point of the change. Personally, I'd like to keep this downstream for now, and move it upstream if we have a need for it in the future. |
Adding a custom ansible filter.
This is mainly to serve as an example that we can extend in the future with more custom filters so we can avoid some of the hairy jinja templating we've needed in the past. (See
etc/kayobe/inventory/group_vars/all/firewall
for example)