Subject: [ansible-project] Ansible - Responding to prompts

On 08.08.2019 03:12, Michael Okonji wrote:

Ansible have no such feature.

If this is a prompt that have something in common or it's possible to create a regexp for you can still use expect.
Lets say the text every time is "Table exist, type continue to continue", then the expect responses looks like this

  Table exist, type continue to continue:
    - continue
    - continue
    - continue

The number of continue don't need to be exact it will work as long as you have the correct amount or more.
So if you only think you get about 20 of this prompt just add 40 of them an it will work.
An other option if you have access to the script/program creating the tables, is to use "create table if not exist" since most databases support this kind of feature.
Kai Stian Olstad