How do I enable additional debugging output from Ansible and Vagrant?

Solution 1:

You can also add this into your Vagrantfile:

ansible.verbose = "vvv"

this would need to go where you're kicking off the provisioning, like this:

config.vm.provision "ansible" do |ansible|
    ansible.verbose = "vvv"

This sets the verbose option of ansible:

-v, --verbose         verbose mode (-vvv for more, -vvvv to enable
                        connection debugging)

Setting this to vvvv (four v's) is useful for debugging SSH connection errors - but it creates a huge amount of debug output, so only use four v's if you're having connection problems.

Solution 2:

I was able to get output like this:

- name: Run puppet
  command: /root/puppet/run_puppet --noop
  register: puppet_output

- name: Show puppet output
  debug: msg="{{ puppet_output.stdout_lines }}"

That at least shows me the output, but unfortunately still not formatted in a very readable way.