Introduction to Ansible Transcripts
Chapter: Running Playbooks
Lecture: Adjusting Output Verbosity

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Ansible told us everything went well
0:02 when we ran our playbook, after we added
0:03 the explicit instruction to use
0:05 the Python 3 interpreter.
0:07 What if we want even more output?
0:08 Surely there's a lot more happening
0:09 under the covers, than just a few
0:11 lines of, okay this was done.
0:13 If you're running into an error
0:14 or you just want to see very detailed information
0:16 when your playbook is running.
0:18 Use the -vvv argument.
0:22 This is for the most verbose output.
0:24 Now instead of just a few lines of output
0:25 we're going to see a whole lot more this time.
0:32 We got a whole lot of information about
0:34 the connection, the specific versions
0:36 of OpenSSH that were used.
0:37 Which modules, that output really flew by
0:40 so one thing you can do, is you can
0:41 also redirect the output from standard out
0:44 which is currently sent to your console, into a file.
0:47 So if you want to save the output somewhere
0:50 the way you can do that, is rerun your command.
0:53 When you're running your command, redirect
0:57 the output to a file named, for example ansible.out
1:01 and when it's finished executing
1:02 be able to open up that file.
1:07 Can open up in our text editor, or we can use
1:10 the typical Linux commands like grep.
1:14 We already saw the four Vs for the most verbose output
1:19 but there is a middle ground where we can
1:20 see more information about what Ansible is doing
1:22 without getting too overwhelmed with
1:24 what's out there.
1:25 And in that case, you can use one -v, two -vv
1:27 three -vvv, or obviously we already saw four -vvvv
1:29 So if you take a look at two -vv
1:31 when we execute our playbook, we see more
1:33 information about what Python version we're using
1:35 and which files are being included in our playbook.
1:37 So two -vv can be a nice middle ground between
1:39 getting overwhelmed with all the output
1:41 and not really being able to see enough.
1:43 So as you're working with Ansible
1:44 if you're running into errors, use
1:46 fully verbose output, and as you get
1:47 more comfortable with Ansible, figure out
1:49 what level of verbosity you're most comfortable with.