Created on 12-25-2016 07:18 AM
1. Installed expect first:
# yum install expect -y
2. Then create and run the following expect script:
# cat /tmp/ambari-server-sync-ldap-unattended.sh #!/usr/bin/expect set timeout 20 spawn /usr/sbin/ambari-server sync-ldap --groups=/etc/ambari-server/ambari-groups.csv expect "Enter Ambari Admin login:" { send "admin\n" } expect "Enter Ambari Admin password:" { send "notTheRealPasswordOfCourse\n" } interact
3. If customer wants password to NOT be in plain text, ask them to look at something like Ansible which handles decrypting passwords from a file.
Created on 07-17-2018 06:29 PM
Hi Sagar,
Thank you for providing details on automating the ldap-sys. It worked wonderfully.
Thanks,
Abhishek