Skip to content

Instantly share code, notes, and snippets.

@DrSnowbird
Created September 4, 2018 22:00
Show Gist options
  • Save DrSnowbird/5d65ae53b2964223f91d2d768a454b7b to your computer and use it in GitHub Desktop.
Save DrSnowbird/5d65ae53b2964223f91d2d768a454b7b to your computer and use it in GitHub Desktop.
Automate Ambari Server install using Expect script
#!/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