Introduction to Ansible Transcripts
Chapter: Running Playbooks
Lecture: Adjusting Output Verbosity
0:00 Ansible told us everything went well when we ran our playbook, after we added the explicit instruction to use the Python 3 interpreter.
0:08 What if we want even more output? Surely there's a lot more happening under the covers, than just a few lines of, okay this was done.
0:14 If you're running into an error or you just want to see very detailed information when your playbook is running. Use the -vvv argument.
0:23 This is for the most verbose output. Now instead of just a few lines of output we're going to see a whole lot more this time.
0:33 We got a whole lot of information about the connection, the specific versions of OpenSSH that were used. Which modules, that output really flew by
0:41 so one thing you can do, is you can also redirect the output from standard out which is currently sent to your console, into a file.
0:48 So if you want to save the output somewhere the way you can do that, is rerun your command. When you're running your command, redirect
0:58 the output to a file named, for example ansible.out and when it's finished executing be able to open up that file.
1:08 Can open up in our text editor, or we can use the typical Linux commands like grep. We already saw the four Vs for the most verbose output
1:20 but there is a middle ground where we can see more information about what Ansible is doing without getting too overwhelmed with what's out there.
1:26 And in that case, you can use one -v, two -vv three -vvv, or obviously we already saw four -vvvv So if you take a look at two -vv
1:32 when we execute our playbook, we see more information about what Python version we're using and which files are being included in our playbook.
1:38 So two -vv can be a nice middle ground between getting overwhelmed with all the output and not really being able to see enough.
1:44 So as you're working with Ansible if you're running into errors, use fully verbose output, and as you get more comfortable with Ansible, figure out
1:50 what level of verbosity you're most comfortable with.