why template_parameters is required to use the cloudformation module?

855 views
Skip to first unread message

Nicolas G

unread,
Nov 18, 2013, 10:24:42 AM11/18/13
to ansible...@googlegroups.com
Hi,

I have a clouformation template that is working with no parameters defined , it's working with no problems with CloufFormation in the AWS console but in order to use it in Ansible it is required to have parameters defined.

If I don't define any parameters in ansible I get the following error :

"""
failed: [localhost] => {"failed": true}
msg: missing required arguments: template_parameters

FATAL: all hosts have already failed -- aborting
"""

If I set a parameter value in Ansible for the same template I get :

"""
failed: [localhost] => {"failed": true}
msg: {"Error":{"Code":"ValidationError","Message":"Parameter values specified for a template which does not require them.","Type":"Sender"},"RequestId":"9b84302e-5064-11e3-bb60-872966d33ed4"}

FATAL: all hosts have already failed -- aborting
"""

Why do we need to set parameters in Ansible if we can use templates with no parameters at all in AWS ? Is there a way to overcome this issue or maybe start considering to remove the template_parameters as a required argument and make it optional  ?

Regards,
Nicolas.

James Martin

unread,
Nov 18, 2013, 11:42:56 AM11/18/13
to ansible...@googlegroups.com
Nicolas,

This is a very good question. I'm the module's original author. When
I wrote it, I didn't foresee people using CloudFormation templates
without parameters. That was short-sighted. Please feel free to
submit a pull request adding this feature.

Thanks,

James
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.

Nicolas G

unread,
Nov 18, 2013, 11:58:36 AM11/18/13
to ansible...@googlegroups.com
hi James,

At the moment I don't have the knowledge and the time for the learning curve to write code and submit a pull request but hopefully I'll be able to do that in the future as I'm planning to write my own modules at some point.

If anyone else willing to submit a pull request, besides removing the template parameters another good improvement will be to remove them completely when the state=absent as they don't have any use at all when you delete a stack.

Thanks for this module James, it works really good ;-)

James Martin

unread,
Nov 18, 2013, 11:24:31 PM11/18/13
to ansible...@googlegroups.com
Nicolas,

File a feature request on github, and if/when I have time, I will try
to make an attempt at it.

Thanks,

James

Michael DeHaan

unread,
Nov 19, 2013, 8:26:33 AM11/19/13
to ansible...@googlegroups.com
Sounds like all is required is to make it required/False and then if set to None, set to {} ?


Michael DeHaan <mic...@ansibleworks.com>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

James Martin

unread,
Nov 19, 2013, 10:50:49 AM11/19/13
to ansible...@googlegroups.com
That should work.

James Martin

unread,
Nov 19, 2013, 2:28:28 PM11/19/13
to ansible...@googlegroups.com
Nicolas,

A time-fairy appeared and granted me a few minutes :)

Feel free to try this: https://github.com/ansible/ansible/pull/4968.
Please comment on that pull request if it works for you.

Thanks

James
Reply all
Reply to author
Forward
0 new messages