I don’t know why my expect command below is not working. I used the regex format tester before doing this.
name: Install Rhapsody
become: no
expect:
command: /tmp/rhapsody-6_2_0-linux-x64.sh
echo: yes
responses:
(^)(?i)OK(.): “o”
(^)(?i)Where should Rhapsody be installed(.): “/rhapsody/rhapsody62/”
(^)(?i)Where should the data directory be located(.): “/rhapsody/rhapsody62/rhapsody/data”
(^)(?i)What memory setting should be used(.): “2048”
(^)(?i)What port settings should be used(.): “3042”
(^)(?i)Secure Web Management Console Port(.): “8445”
(^)(?i)Secure Management Webservice Port(.*): “8450”
Does it actually install when using the expect module? It seems as though the failure is because you are getting a return code of 1. If it does install, it might indicate that an rc of 1 is not a failure.
What is the return code after you run it manually/interactively?
No it doesn’t install. I am having a hard time figuring out what return code 1 means or how to get a return code when I do a manual install. This .sh file is a packaged installer from a vendor we use that I am trying to automate, so I don’t have much insight into return codes.
I put in my script for every response question (.*) and now the script just sits there. What would be the correct python regex for capturing everything including new line? At this point I am just trying to grab anything to see if there issue is the response questions.