Created
December 2, 2017 18:19
-
-
Save beddari/f8bfea46a0a9e8e3888d50a2994d792e to your computer and use it in GitHub Desktop.
Ansible list formatting filter_plugin
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
def format_list(list_, pattern): | |
return [pattern % s for s in list_] | |
class FilterModule(object): | |
def filters(self): | |
return { | |
'format_list': format_list, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment