# record remote SSH session of Ansible as a commands transcript

**URL:** <https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622>\
**Category:** Ansible Project\
**Created:** [February 21, 2014, 4:57pm UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622 "2014-02-21T16:57:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anatoly\_techtonik](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@anatoly\_techtonik](https://forum.ansible.com/u/anatoly_techtonik)\
**Post date:** [February 21, 2014, 4:57pm UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622/1 "2014-02-21T16:57:48Z")

</div>

[Debian upgrade instructions](http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html) contain very useful advice - record shell session  
of upgrade process with screen:

> It is strongly recommended that you use the **/usr/bin/script** program to record a transcript of the upgrade session. Then if a problem occurs, you will have a log of what happened, and if needed, can provide exact information in a bug report. To start the recording, type:
> 
> # script -t 2\>~/upgrade-wheezy\*`step`_.time -a ~/upgrade-wheezy_`step`\*.script

Is it possible to record invisible Ansible session in the same way? That would  
be a killer feature that help people to understand how certain playbook work  
and enhance Ansible on the way.

Why I think it is possible? Because Ansible uses only SSH only, and  
everything you type in SSH can be recorded.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 21, 2014, 5:07pm UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622/2 "2014-02-21T17:07:01Z")

</div>

Ansible doesn’t “type” in SSH, but actually transfers and executes modules.

Thus the playbook is the best indication of what you are intending to do, and what you did.

---

<div class="post-metadata">

**Author:** ![anatoly\_techtonik](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@anatoly\_techtonik](https://forum.ansible.com/u/anatoly_techtonik)\
**Post date:** [February 21, 2014, 7:40pm UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622/3 "2014-02-21T19:40:30Z")

</div>

Ok. That clarifies it a bit, but even if so, the output is only captured on demand,  
and the sequence of actual transfer and execute commands is not visible. Is it  
possible to dump in a human readable manner? playbook is a good plan  
overview, but not always what really happens.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 21, 2014, 9:05pm UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622/4 "2014-02-21T21:05:25Z")

</div>

“Ok. That clarifies it a bit, but even if so, the output is only captured on demand,  
and the sequence of actual transfer and execute commands is not visible”

That’s not entirely true. Check out -vvv.

---

<div class="post-metadata">

**Author:** ![Jesse\_Keating](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Jesse\_Keating](https://forum.ansible.com/u/Jesse_Keating)\
**Post date:** [February 21, 2014, 10:24pm UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622/5 "2014-02-21T22:24:41Z")

</div>

You can use -vvv (or -vvvv for full ssh debugging) as well as ANSIBLE\_LOG\_PATH=file. More v's will show you more interaction, and the log path will record everything for review at a later time.

-jlk

---

<div class="post-metadata">

**Author:** ![anatoly\_techtonik](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@anatoly\_techtonik](https://forum.ansible.com/u/anatoly_techtonik)\
**Post date:** [February 23, 2014, 6:37am UTC](https://forum.ansible.com/t/record-remote-ssh-session-of-ansible-as-a-commands-transcript/14622/6 "2014-02-23T06:37:09Z")

</div>

Great. Just what I need. Thanks.
