Is there a way to use ansible playbook which will open possibility to answer on shell script prompt by user who runs ansible script?
You can use the expect module. Example:
- name: Upgrade Ubuntu w do release upgrade
expect:
command: do-release-upgrade
responses:
'First Question in the prompt' : 'y'
'Second Question in the prompt' : 'y'
However, you want to execute the do-release-upgrade without prompts.
- shell: do-release-upgrade -f DistUpgradeViewNonInteractive
Please note:
- Ensure to have a back-up and/or snapshot in place before upgrading
- Ensure all packages are latest version
- Ensure update-manager-core is installed
- Ensure to reboot the machine after the do-release-upgrade
Also, please read my first comment. Since you do not have an SSH connection to the machine, it's really hard to debug and see what is going on if something went wrong.
Note that Ubuntu will leave logs by default at /var/log/dist-upgrade
, use these to check/verify the upgrade. They provide a lot of help!
expect:
? – Adrianadriana