interpolated parameterized role dependencies

81 views
Skip to first unread message

alexa...@gmail.com

unread,
Oct 15, 2014, 1:34:20 PM10/15/14
to ansible...@googlegroups.com
Hey guys, first of all, I think Ansible is a great project. In my most recent project, I've started to explore the various ways to manage configurations, and one of the schemes that I wanted to explore was using parameterized role dependencies. Essentially, the setup of the problem is similar to: https://github.com/sivel/ansible-training-content/blob/master/advanced/chapter_08.yml#L105
When I define a role, I'd like to be able to define inside meta/main.yml, not only the dependencies, but also the parameters passed into the dependencies (interpolated). Here is an example: http://pastebin.com/rwmnke9V
I have set hash_behavior to merge because I want to essentially pass in a dictionary to each role dependency (which houses the parameters they need to function).
Ansible errors out with: AttributeError: 'unicode' object has no attribute 'iteritems'
What's strange is that this sort of interpolation works within playbooks, in that I can use the exact same syntax to be able to pass dictionary values into roles for plays. Is this a use case that ansible can satisfy, and/or am I doing something wrong? Thanks for reading!

Michael DeHaan

unread,
Oct 20, 2014, 5:17:32 PM10/20/14
to ansible...@googlegroups.com
I think the best thing here is to file a minimal reproducer in GitHub that shows how to reproduce your unicode error, it is probably not explicitly a role dependency thing but something we just need to handle.

Be sure your Ansible version is at least 1.7.2 before filing.

Thanks!



--
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/f4708941-e382-4084-a9e0-e685f4d1b8f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages