Run shell script that needs user input

33 views
Skip to first unread message

Aleksandar Ilic

unread,
Dec 8, 2021, 5:23:10 PM12/8/21
to Ansible Project
Hello everyone,

I have been trying to find a solution to run a sh script via ansible but the script requires users that run the script to enter username and password.

Is it possible to pass those vars via ansible?

Regards

 

Antony Stone

unread,
Dec 8, 2021, 5:29:02 PM12/8/21
to ansible...@googlegroups.com
a) not unless the script supports it

b) you might try using 'expect' to see if that can pretend to be a user at a
keyboard.

Antony.

--
"In fact I wanted to be John Cleese and it took me some time to realise that
the job was already taken."

- Douglas Adams

Please reply to the list;
please *don't* CC me.

Mike Eggleston

unread,
Dec 8, 2021, 5:34:00 PM12/8/21
to ansible...@googlegroups.com
You can also use the Ansible -e and use the variable is the script.

Mike

> On Dec 8, 2021, at 16:28, Antony Stone <Antony...@ansible.open.source.it> wrote:
Reply all
Reply to author
Forward
0 new messages