>> Could you please explain how can use xterm command : xterm --tn dumb -cm 
-dc -e this is your command
   Fustratigly, xterm is not present in remote  machine and I am not 
allowed to install xterm utility on targeted remote machine. Still, is 
there any way to run it through ansible conroller?


On Saturday, 18 April 2020 14:45:18 UTC+5:30, Samir Kothawade wrote:
>
> Hi, 
>
> *Here is the brief about scenario: *
>
> 1. login to Debian host machine using ansible
> 2. Go to corresponding directory where the binary is and execute that 
> binary. (This binary is written in c and C++. After execution it ask for 
> the userid & password) 
> 3. After login into that binary's shell, it  has several commands which 
> displays statistics. Those stats are lengthy and does not fit in current 
> screen resolution. For seen seeing all the stats we have to press Down 
> arrow Key or Enter key multiple time until we reach to last stat line.
>
> *How I am doing this: *
>
> *-** hosts: sam*
> *  gather_facts: no*
> *  tasks:*
> *  - name: capture all stats*
> *    ignore_errors: yes*
> *    expect:*
> *      command: /opt/abc/xyz_Platform/bin/go_xyz_cli*
> *      responses:*
> *        (.*)Username:(.*): "admin"*
> *        (.*)Password:(.*): "admin"*
> *        (.*)xyz_cli>(.*): display all debug stats*
> *        (.*):(.*): ''* 
> *    register: stats*
> *  - local_action: copy content="{{ stats.stdout}}" 
> dest="/home/sam/quickstats/stats.txt"*
> *    ignore_errors: yes*
>     
>
> *Issues Facing : *
>
> 1. Multiple similar line gets copied in stats.txt file when above reaches 
> to ==>>*  (.*):(.*): ''*  (See above code section marked in blue). Using 
> this method to press <enter> key.  
> 2. Actual stats counts are of line 500 hundred but above code returns 2k + 
> stats with repetitive stats and some garbage values appended.
> 3. If i removes this  portion *  (.*):(.*): ''*  from code, then above 
> script only copies 20-30 lines which currently are displayed on screen or 
> which displayed in current screen size. 
>
>
> I guess I can achieve this by changing remote servers' screen size. but I 
> could not able to get any such way in ansible. 
>
>
> May I request you to help me in this ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2f760261-f3ca-420b-86a5-d9eb2ed85206%40googlegroups.com.

Reply via email to