Sending Break/Escape Sequence hot keys via a play

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

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.

Awesome. Will try and let you know. Thanks for your time.