We have a new open source ansible role that automates compilation of some custom router (OpenWRT) images called openwisp2-image-generator
The root password of the root user can be defined in the playbook YAML, but the process to do so is cumbersome.
I would like to let users to define their password and salt in clear text on the YAML and then behind the scene do something like:
import crypt;
password = crypt.crypt('password', '$1$salt-here$')
That value should be stored in a variable so I can easily add it into the right role templates.
Can I run that python code locally instead of remotely? What's the best way to do this?