pushkargogte opened a new pull request, #1193: URL: https://github.com/apache/ranger/pull/1193
…ger docker ## What changes were proposed in this pull request? This update makes it easier to test LDAP UserSync by bringing a ready-to-use OpenLDAP directory directly into the Apache Ranger Docker environment. * **New LDAP Container:** Added a Docker Compose service using the `osixia/openldap` image. * **Schema Configuration:** Updated Ranger Admin and UserSync properties to use standard OpenLDAP attributes (like `inetOrgPerson`, `groupOfNames`, and `uid`). * **Delta Sync Enabled:** Turned on `SYNC_LDAP_DELTASYNC="true"` to accurately simulate how enterprise environments handle updates. * **Network Ready:** Set up the required container networking so Ranger connects to the LDAP directory ## How was this patch tested? I verified this patch locally by running through a full build and deployment cycle: 1. Successfully compiled Ranger Admin using the `mvn clean compile package install` command. 2. Deployed the full Ranger stack (including the new `local-ldap` container) using `docker-compose up -d`. 3. Verified that the Ranger Docker setup successfully synced users and groups from the local LDAP directory. 4. Confirmed functionality by successfully logging into the Ranger UI as one of the synced LDAP users. ### 🛠️ Testing / Setup Instructions: OpenLDAP with Ranger Docker To verify the OpenLDAP integration with the Ranger Docker setup, please follow these steps: **1. Run the prerequisite setup script** Execute the setup script to configure the required integration settings for the Docker environment. ```bash ./ldap_us_setup.sh ``` **2. Clean up existing infrastructure** Tear down any running containers and clear dynamic volumes to ensure a clean state. ```bash docker compose -f docker-compose.ranger.yml -f docker-compose.ranger-usersync.yml -f docker-compose.ranger-tagsync.yml -f docker-compose.ranger-pdp.yml -f docker-compose.ranger-kms.yml -f docker-compose.local-ldap.yml down -v ``` **3. Boot the fresh container environment** Start the entire cluster ecosystem simultaneously in detached mode. ```bash docker compose -f docker-compose.ranger.yml -f docker-compose.ranger-usersync.yml -f docker-compose.ranger-tagsync.yml -f docker-compose.ranger-pdp.yml -f docker-compose.ranger-kms.yml -f docker-compose.local-ldap.yml up -d ``` **4. Inject directory mappings** Wait briefly for the LDAP container to initialize, then load the user/group configurations *before* UserSync executes its initial lookup. ```bash sleep 10 docker exec -i local-ldap ldapadd -c -x -D "cn=admin,dc=example,dc=com" -w p@ssw0rd < ldapusergroup.ldif ``` **5. Force UserSync discovery** Allow time for the Ranger Admin tables to finish building, then cycle the UserSync container to force discovery of the newly mapped users. ```bash sleep 60 docker restart ranger-usersync ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
