1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add base64 encode and decode filters to templates

This commit is contained in:
Stoned Elipot 2013-04-10 02:30:31 +02:00
parent c64f19dc5f
commit 0893562605

View file

@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
import base64
import json
import yaml
@ -31,6 +32,10 @@ class FilterModule(object):
def filters(self):
return {
# base 64
'b64decode': base64.b64decode,
'b64encode': base64.b64encode,
# json
'to_json': json.dumps,
'to_nice_json': to_nice_json,