Created
September 4, 2018 22:00
-
-
Save DrSnowbird/5d65ae53b2964223f91d2d768a454b7b to your computer and use it in GitHub Desktop.
Automate Ambari Server install using Expect script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -- | |
## To use: | |
## expect -f ./automate-ambari-server-setup.exp | |
## | |
set timeout 300 | |
spawn /usr/sbin/ambari-server setup | |
expect { | |
"Customize user account for ambari-server daemon " { | |
send "n\r" | |
exp_continue | |
} | |
"OK to continue " { | |
send "y\r" | |
exp_continue | |
} | |
"Do you want to change Oracle" { | |
send "n\r" | |
exp_continue | |
} | |
"Enter choice " { | |
send "3\r" | |
exp_continue | |
} | |
"Path to JAVA_HOME" { | |
send "/usr/java/default\r" | |
exp_continue | |
} | |
"Enter advanced database configuration " { | |
send "n\r" | |
exp_continue | |
} | |
"completed successfully" { | |
send "n\r" | |
interact | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment