Im a newbie to ansible, and im trying to write an ansible script which would continuously prompt user to insert data and use the data to perform some tasks until the user decides to end the loop, a shell script serving the same purpose would look like this.
read -s -p "Create new directory? y/n: " response while [[ "$response" == "y" ]] do read -s -p "Enter the name of direcory: " name mkdir $name if [ $? -ne 0 ] then echo "Failed to create new directory $name" exit 1 fi read -s -p "Create another new directory? y/n: " response done
so how do i go about this?