Swiss-army knife to synchronize Postgres roles from any LDAP directory.
- Creates and drops PostgreSQL roles from LDAP queries.
- Manage role options (
CREATE
andALTER
). - Manage role members (alias groups).
- Dry run.
- logs LDAP queries as
ldapsearch
commands. - logs every SQL queries.
- Reads settings from YAML config file.
$ cat ldap2pg.yml sync_map: ldap: base: ou=people,dc=ldap2pg,dc=local filter: "(objectClass=organizationalRole)" attribute: cn role: name_attribute: cn $ ldap2pg INFO Starting ldap2pg 0.1. INFO Creating new role alice. WARNI Dropping existing role toto. INFO Synchronization complete. $
See versionned ldap2pg.yml for further options.
Install it from GitHub tarball:
pip install https://github.com/dalibo/ldap2pg/archive/master.zip
ldap2pg
is licensed under PostgreSQL license.