Ansible user-interactive module while running shell script

Viewed 18036

I am new to ansible and trying to learn basic things...

I am trying to execute a below shell script with ansible...This script has case condition included which needs a user input. But while running in ansible, it's not asking anything and completing a task. I want my ansible to ask a i/p during executing and accordingly execute the script.

- hosts: localhost
  tasks:
  - name: Execute the script
    shell: /usr/bin/sh /root/ansible_testing/testing.sh

snippet of shell script is...

 echo "Press 1 for Backup"
 echo "Press 2 for MakeChange"
 echo "Press 3 for Keepsafe"
 echo "*******************************************"

 echo -n "Enter your choice : "
 read choice2

 case $choice2 in
 1)

   echo "Hello"
1 Answers
Related