please excuse my ignorance but I am very new to the linux and server management space

Use case scenario -

I have 20 linux servers and I need to install the same package/script across all these servers. The challenge is that during installation of this script, there are few steps where it would prompt for some inputs(such as password, Y/N options, etc..).

Solution researched -

I found some videos on how to use ansible to send commands across multiple remote servers, however the challenge that when the installation is running on the remote server, they would promt to input password or Y/N questions in order for the installation to continue and end on completion.


I could not find a solution that would enable me to do this unless I manually SSH into each of these server and enter the inputs.

Can anyone help me? Also please remember I am very new to this so any help in details would be highly appreciated.

  • what distro are you running on these 20 servers? and what packages/scripts do you need to install? Without details, it's hard to give more than a generic "for most distros, almost all packages can be installed in a fully-automated manner with a preseed cfg file or similar feature. for stuff installed with brawndo-installer (curl $url | sudo bash - it's got electrolytes!), all bets are off - look into running expect (or perl's Expect.pm or Net::SSH or similar, or python's pexpect module)."
    – cas
    May 7, 2021 at 15:42

1 Answer 1


Your best approach is to find an invocation of the installer that doesn't prompt. Many installers will have an automated mode where you can provide command line options and/or a configuration file, and they will then run in an "unattended" mode, not prompting the user with questions.

If there isn't an unattended mode available for this particular program / package / script, then you should drop the idea of Ansible, since Ansible is incompatible on very basic levels with being prompted during execution, and look in to something like expect. You can combine Ansible with an expect script, but that may be more effort than is worth the return.

  • Thanks for the response, I was wondering, is their any way where I can open the outputs from the remote server on separate window or application when the installation is taking place? May 7, 2021 at 15:08
  • Unlikely - look at the docs for expect and see if there's anything you can do there. Last time I used it, though, STDOUT went to the expect script, which it had to do for expect to work correctly.
    – John
    May 7, 2021 at 16:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .