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

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0a9b1792-4935-7872-f0c9-4ff9e4fa2bba%40stroeder.com.

Reply via email to