Sending Break/Escape Sequence hot keys via a play

27 views
Skip to first unread message

ayyappan ramanan

unread,
Nov 17, 2017, 4:38:48 PM11/17/17
to Ansible Project
Hi All,

I am unsure if this question has been raised before. I use Ansible for network automation and it has been working great so far.

I am trying to use Ansible/Ansible Tower to automate a virtual network lab on GNS3. As you may be aware already, GNS3 provides a sleak Out-of-the-band management by tying the console ports of virtualised router and switch instances over a telnet port. Application users can telnet on to that port to configure the virtual network to suit their needs.

When I access my labs manually, when I am done working, I need to use a Break Sequence of 'Ctrl + ]' and exit the terminal

With Ansible, when ever I have to telnet on to a network device through its VTY line, I use RAW and PARAMIKO modules.

My question is which module do I use in my ansible playbook and how do I send 'Ctrl + ]' or any hot key combination for that matter to my target device.

Any thoughts/suggestions?

Thanks,
AR

Kai Stian Olstad

unread,
Nov 17, 2017, 5:10:49 PM11/17/17
to ansible...@googlegroups.com
If you use expect it is possible, if it work with Ansible's expect module I don't now, you need to try.

The expect sequence for Ctrl + ] is "\x1d" and you need to keep the double quotes around it in Ansible for it to work.


--
Kai Stian Olstad

ayyappan ramanan

unread,
Nov 17, 2017, 6:55:30 PM11/17/17
to ansible...@googlegroups.com
Awesome. Will try and let you know. Thanks for your time.


From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of Kai Stian Olstad <ansible-pr...@olstad.com>
Sent: Saturday, November 18, 2017 9:10:22 AM
To: ansible...@googlegroups.com
Subject: Re: [ansible-project] Sending Break/Escape Sequence hot keys via a play
 
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/hSfPYBoE8V4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/1572389.E8bD87bH08%40x1.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages