record remote SSH session of Ansible as a commands transcript

130 views
Skip to first unread message

anatoly techtonik

unread,
Feb 21, 2014, 11:57:48 AM2/21/14
to ansible...@googlegroups.com
Debian upgrade instructions 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-wheezystep.time -a ~/upgrade-wheezystep.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.

Michael DeHaan

unread,
Feb 21, 2014, 12:07:01 PM2/21/14
to ansible...@googlegroups.com
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.


--
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-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

anatoly techtonik

unread,
Feb 21, 2014, 2:40:30 PM2/21/14
to ansible...@googlegroups.com
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.

Michael DeHaan

unread,
Feb 21, 2014, 4:05:25 PM2/21/14
to ansible...@googlegroups.com
"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.


Jesse Keating

unread,
Feb 21, 2014, 5:24:41 PM2/21/14
to ansible...@googlegroups.com
On 2/21/14, 11:40 AM, anatoly techtonik wrote:
> 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.

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

anatoly techtonik

unread,
Feb 23, 2014, 1:37:09 AM2/23/14
to ansible...@googlegroups.com
Great. Just what I need. Thanks. 
Reply all
Reply to author
Forward
0 new messages