This section of code handles prompting for the enable password:
// The enable command will elevate the prompt if possible.
cli.send("enable\n")
cli.expect(["(?i)password:", "${prompt[0..-2]}[>#\$]", prompt] as String[], smallBufferSize)
if (cli.matched().toLowerCase().contains("password")) {
cli.send("${epas}\n")
cli.expect(rawPrompt, smallBufferSize)
}
Are you saying that after entering "enable" at the prompt, it asks you for the username again? I hadn't seen that, but i haven't touched Aruba in a while.
If it's just asking for the password, the script already tries to pass in the password as contained in the "epas" variable. That variable is set at the beginning of the script using this line:
def epas = hostProps.get("ssh.enable.pass") ?: hostProps.get("config.enable.pass") ?: pass
So, you should be able to just set "config.enable.pass" to the enable password on the device and it'll work. The "?: pass" bit at the end sets it to be the same as the logon password if you don't specify it.