CloudFormation - how to debug where the issue is

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

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,

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)