# Debugging Ansible with Packer

**URL:** <https://forum.ansible.com/t/debugging-ansible-with-packer/19552>\
**Category:** Ansible Project\
**Created:** [October 19, 2015, 8:21pm UTC](https://forum.ansible.com/t/debugging-ansible-with-packer/19552 "2015-10-19T20:21:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_Sowatskey](https://avatars.discourse-cdn.com/v4/letter/n/4da419/32.png) [@Nathan\_Sowatskey](https://forum.ansible.com/u/Nathan_Sowatskey)\
**Post date:** [October 19, 2015, 8:21pm UTC](https://forum.ansible.com/t/debugging-ansible-with-packer/19552/1 "2015-10-19T20:21:44Z")

</div>

Hi

Does anyone know how to debug what Ansible is doing as part of a Packer build please?

Using packer -debug did not help.

In effect I need a way to introduce the -vvvvv argument to Ansible from within Packer, or to configure debug in a playbook.

Many thanks

Nathan

Nathan John Sowatskey  
Programmable Infrastructure, DevOps and SDN  
[nathan@nathan.to](mailto:nathan@nathan.to)

[https://es.linkedin.com/in/nathansowatskey](https://es.linkedin.com/in/nathansowatskey)  
XMPP: [nathandotto@im.koderoot.net](mailto:nathandotto@im.koderoot.net)  
Google: [nathanjohnsowatskey@gmail.com](mailto:nathanjohnsowatskey@gmail.com)  
Skype: nathan\_sowatskey  
Twitter: NathanDotTo

[http://www.kipling.org.uk/poems\_if.htm](http://www.kipling.org.uk/poems_if.htm)

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 19, 2015, 8:57pm UTC](https://forum.ansible.com/t/debugging-ansible-with-packer/19552/2 "2015-10-19T20:57:37Z")

</div>

If Packer is the one calling ansible, you might want to ask the Packer  
crowd. Debug is not configurable from withing a playbook.

---

<div class="post-metadata">

**Author:** ![Nathan\_Sowatskey](https://avatars.discourse-cdn.com/v4/letter/n/4da419/32.png) [@Nathan\_Sowatskey](https://forum.ansible.com/u/Nathan_Sowatskey)\
**Post date:** [October 20, 2015, 5:03am UTC](https://forum.ansible.com/t/debugging-ansible-with-packer/19552/3 "2015-10-20T05:03:12Z")

</div>

{

“type”: “ansible-local”,

“playbook\_file”: “playbooks/setup\_devvm.yml”,

“extra\_arguments”: “-vvvvv”

}

---

<div class="post-metadata">

**Author:** ![Jeremy\_Young](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@Jeremy\_Young](https://forum.ansible.com/u/Jeremy_Young)\
**Post date:** [October 20, 2015, 11:20am UTC](https://forum.ansible.com/t/debugging-ansible-with-packer/19552/4 "2015-10-20T11:20:58Z")

</div>

This is definitely a Packer question, but you can increase verbosity of the playbook run by doing something like this:

{  
“type”: “ansible-local”,  
“playbook\_dir”: “/home/jyoung/git/ansible/playbooks”,  
“staging\_directory”: “/opt/jeremydemo”,  
“command”: “ansible-playbook -vvvv”,  
“playbook\_file”: “/home/jyoung/git/ansible/playbooks/packer\_centos7\_stig.yml”  
}
