mikecher.ansible_role_openldap

OpenLDAP Ansible role for install, create, delete, search users

At this point the role only supports SHA512 encryption and the passwordhash can be obtained using bash:

echo -n 'your_password' | openssl dgst -sha512 -binary | openssl enc -base64

for install openldap-server

ansible-playbook openldap.yml -t install_server

for instance, for a username john.doe create with password 'my_password' you would need

ansible-playbook openldap.yml -t create_user  -e "firstName=John" -e "lastName=Doe" -e "passwordHash={SHA512}3ajDRohg3LJOIoq47kQgjUPrL1/So6U4uvvTnbT/EUyYKaZL0aRxDgwCH4pBNLai+LF+zMh//nnYRZ4t8pT7AQ=="

when you need to delete users on a running LDAP instance, you can just add them here and run the role again as every run will wipe out all the directory and start again

ansible-playbook openldap.yml -t delete_user -e "passwordHash={SHA512}3ajDRohg3LJOIoq47kQgjUPrL1/So6U4uvvTnbT/EUyYKaZL0aRxDgwCH4pBNLai+LF+zMh//nnYRZ4t8pT7AQ==" 

when you need list of users on a running LDAP instance, you can do this

ansible-playbook openldap.yml -t search

for install openldap-client

ansible-playbook openldap.yml -t install_client

for create group

 ansible-playbook openldap.yml -t create_group   -e "passwordHash={SHA512}3ajDRohg3LJOIoq47kQgjUPrL1/So6U4uvvTnbT/EUyYKaZL0aRxDgwCH4pBNLai+LF+zMh//nnYRZ4t8pT7AQ=="

for add user to group:

  1. use search for take uid
 ansible-playbook openldap.yml -t add_user_to_group  -e "passwordHash={SHA512}3ajDRohg3LJOIoq47kQgjUPrL1/So6U4uvvTnbT/EUyYKaZL0aRxDgwCH4pBNLai+LF+zMh//nnYRZ4t8pT7AQ=="

delete user from group

  1. use search for take uid
 ansible-playbook openldap.yml -t delete_user_from_group  -e "passwordHash={SHA512}3ajDRohg3LJOIoq47kQgjUPrL1/So6U4uvvTnbT/EUyYKaZL0aRxDgwCH4pBNLai+LF+zMh//nnYRZ4t8pT7AQ=="

delete group

 ansible-playbook openldap.yml -t delete_user_from_group  -e "passwordHash={SHA512}3ajDRohg3LJOIoq47kQgjUPrL1/So6U4uvvTnbT/EUyYKaZL0aRxDgwCH4pBNLai+LF+zMh//nnYRZ4t8pT7AQ=="
About

OpenLDAP server forDebian/Ubuntu.

Install
ansible-galaxy install mikecher.ansible_role_openldap
GitHub repository
License
mit
Downloads
39
Owner