Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
use binascii.unhexlify() in Jinja2 template
12 views
Skip to first unread message
Michael Ströder
unread,
Feb 11, 2020, 12:33:03 PM
2/11/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
HI!
I'm using stat task to let ansible calculate the SHA-512 checksum of a
file on the managed node [1] which returns hex-encoded hash values.
Now I have to convert the checksum to bytes prior to base64-encoding
this byte string.
In Python code I would use the function binascii.unhexlify(). But how to
do this in a Jinja2 template?
(I'm doing this to implement Subresource Integrity [3].)
Thanks in advance.
Ciao, Michael.
[1]
https://docs.ansible.com/ansible/latest/modules/stat_module.html
[2]
https://docs.python.org/3/library/binascii.html#binascii.unhexlify
[3]
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
Reply all
Reply to author
Forward
0 new messages