# CloudFormation - how to debug where the issue is

**URL:** <https://forum.ansible.com/t/cloudformation-how-to-debug-where-the-issue-is/18447>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [June 9, 2015, 4:28pm UTC](https://forum.ansible.com/t/cloudformation-how-to-debug-where-the-issue-is/18447 "2015-06-09T16:28:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cosbug](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@cosbug](https://forum.ansible.com/u/cosbug)\
**Post date:** [June 9, 2015, 4:28pm UTC](https://forum.ansible.com/t/cloudformation-how-to-debug-where-the-issue-is/18447/1 "2015-06-09T16:28:26Z")

</div>

Hi All,

While running a playbook I get very poor information regarding the possible root cause of error.

`

# ansible-playbook -i hosts aws-cf-provision.yml -vv

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [Create VPC, internet gateway, route tables and security groups] \*\*\*\*\*\*\*\*  
\<127.0.0.1\> REMOTE\_MODULE cloudformation template=VPCStack.json state=present region=eu-west-1 stack\_name=VPCStack-dev aws\_access\_key=\*\*\*\*\*\*\*\* aws\_secret\_key=` ******** `  
failed: [127.0.0.1] =\> {“failed”: true}

FATAL: all hosts have already failed – aborting

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Create VPC, internet gateway, route tables and security groups -------- 201.80s  
to retry, use: --limit @/root/aws-cf-provision.retry

127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1

Enter code here…  
`

If I run CloudFormation script form command line it just works fine. Is there any way how it can be debugged?  
-vvvv switch doesn’t give much clue.

Regards,  
Constantin

---

<div class="post-metadata">

**Author:** ![benno\_joy](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@benno\_joy](https://forum.ansible.com/u/benno_joy)\
**Post date:** [June 9, 2015, 4:32pm UTC](https://forum.ansible.com/t/cloudformation-how-to-debug-where-the-issue-is/18447/2 "2015-06-09T16:32:54Z")

</div>

can you please try with -vvv three v’s / the module does return the events returned by aws, can you check in the aws console if there were any errors in the operation . and also what version if ansible are you using,

---

<div class="post-metadata">

**Author:** ![cosbug](https://avatars.discourse-cdn.com/v4/letter/c/13edae/32.png) [@cosbug](https://forum.ansible.com/u/cosbug)\
**Post date:** [June 9, 2015, 5:33pm UTC](https://forum.ansible.com/t/cloudformation-how-to-debug-where-the-issue-is/18447/3 "2015-06-09T17:33:21Z")

</div>

Here is the output:

`

# ansible-playbook -i hosts aws-cf-provision.yml -vvv

PLAY [localhost] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK: [Create VPC, internet gateway, route tables and security groups] \*\*\*\*\*\*\*\*  
\<127.0.0.1\> REMOTE\_MODULE cloudformation template=VPCStack.json state=present region=eu-west-1 stack\_name=VPCStack-dev aws\_access\_key=` ********`aws\_secret\_key=`******** `  
\<127.0.0.1\> EXEC [‘/bin/sh’, ‘-c’, ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1433870269.59-122126194272846 && echo $HOME/.ansible/tmp/ansible-tmp-1433870269.59-122126194272846’]  
\<127.0.0.1\> PUT /tmp/tmp67hFaK TO /root/.ansible/tmp/ansible-tmp-1433870269.59-122126194272846/cloudformation  
\<127.0.0.1\> EXEC [‘/bin/sh’, ‘-c’, u’LANG=C LC\_CTYPE=C /usr/bin/python /root/.ansible/tmp/ansible-tmp-1433870269.59-122126194272846/cloudformation; rm -rf /root/.ansible/tmp/ansible-tmp-1433870269.59-122126194272846/ \>/dev/null 2\>&1’]  
failed: [127.0.0.1] =\> {“failed”: true}

FATAL: all hosts have already failed – aborting

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
Create VPC, internet gateway, route tables and security groups -------- 318.70s  
to retry, use: --limit @/root/aws-cf-provision.retry

127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1

`

Sometimes it works fine, sometimes it fails. Cannot figure out the reason yet. The AWS Console doesn’t show any errors but it takes too long to create a stack.  
If I run JSON template through AWS console - it takes much less to run.

# rpm -qa | grep ansible

ansible-1.9.1-1.el7.noarch  
ansible-tower-2.1.4-1.el7.centos.noarch

# cat /etc/redhat-release

CentOS Linux release 7.1.1503 (Core)
