You can do this via shelling out via generate() on the puppetmaster:
$salt = 'dqwdqaom'
$password = 'mycleartextpassword'
$md5_password = generate('/bin/sh', '-c', "/usr/bin/mkpasswd -H md5 -S
$salt '$passwd' | tr -d '\n'")
Ugly, but it works.
The pretty way of doing this would be to create a custom function.
We're intending on doing this, but it's not there yet.
Cheers,
Mike