ansible 2.1.4.0
I am trying to use ansible module to execute a sciprt < custom work flow> . I have notices that ansible allows me to enter only one prompt 'y' from the question generated out of the custom script.
I tried to use 'command' or 'expect' modules, but also didn't work as it expect pexpect modules .
I moved my command from a module to a bash file and asked ansible to run the file but also same issue. < not allowing more than one promot at a time>
any Idea how to fix this issue? what module or expression i should be using?
here is my task :
------------------------------------------------------------------
[root@a9]# cat /tasks/main.yaml
---
- name: place generated config file into active VM
template: src=config-template dest=/root/config-file owner=root group=root mode=0644
- name: bash file
template: src=run.bash dest=/root/run.bash owner=root group=root mode=0777
- name: Run
shell: /root/run.bash | tee -a /root/template.cfg
register: myoutput
- name: variableoutput
debug: msg="{{ myoutput }}"
-------------------------------------------------------------------
[root@a]# cat /templates/run.bash
#!/bin/bash
/bin/printf "y\ny\n" | /opt/config/bin/MyScript -f /root/config-file
----------------------------------------------------------------------------
Task is stucked here with no action .
Thank you!
Noura
Jon