Ldap hiera variable lookup

I was searching for a way for Puppet to get, via Hiera, variables in LDAP for parameterized classes. And found Arnaud Gomes code. Maybe it is useful for more people. It is possible to put hashes in ldap variables via JSON.