CloudFormation - how to debug where the issue is

164 views
Skip to first unread message

cos...@gmail.com

unread,
Jun 9, 2015, 12:28:26 PM6/9/15
to ansible...@googlegroups.com
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

benno joy

unread,
Jun 9, 2015, 12:32:58 PM6/9/15
to ansible...@googlegroups.com
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,



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2f18d896-1765-4626-94b7-a64a77c8cde0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cos...@gmail.com

unread,
Jun 9, 2015, 1:33:21 PM6/9/15
to ansible...@googlegroups.com
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)

Reply all
Reply to author
Forward
0 new messages