ERROR: file could not read: .../my-ansible/a_task_that_sits_in_xxx_role.yml
What I expected is that an include in a playbook will search for a task to include in play's roles.
Is it a bug?
--
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/67cb019c-471b-46ca-82d0-46760f8f4677%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
It's not a bug.
It's also a little weird, it's not expected that you would manually include a task file from a role directory without using roles, but if you wanted to, you would have to path it in the various subdirectories.
--
On Wed, Jun 25, 2014 at 7:03 AM, Руслан Закиров <r...@sports.ru> wrote:
Hi,--
I hoped for the following to work from a playbook:
- hosts: backendsroles:- common- perl-apptasks:- include: a_task_that_sits_in_xxx_role.yml
But I get:
ERROR: file could not read: .../my-ansible/a_task_that_sits_in_xxx_role.yml
What I expected is that an include in a playbook will search for a task to include in play's roles.
Is it a bug?
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/67cb019c-471b-46ca-82d0-46760f8f4677%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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/CA%2BnsWgw_Tu3Jbf9-JsYLp6Kc_h%3D4Vchy5jabzavuE21NRMq1rw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53AC502A.6010300%40faita.net.
"Would be great to have a magic variable to obtain the path to roles tasks, to allow for things like:"
I feel it would be pretty esoteric and infrequently used, we tend to push back on extra magic until enough use cases for them start to appear.
Usually roles don't import tasks straight out of other roles, and would use role dependencies in the cases where they did.
You should be able to know the relative pathing in nearly all cases though.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyrBeMs%3DdvcHh821LM6HiM3PyMHRf-T2xD5vdn8Zq_Tyw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53AD5E8E.6030205%40faita.net.
" For example, a munin role may ask apache role to create a virtualhost, if it finds apache is available."
Role dependencies can include "when" statements. The conditionals will be applied to each task in the role, so the parameters would need to be loaded first, i.e in your role dependencies:
{ role: apache, when: has_apache }
Since these happen before the role, you would need to set "has_apache" via register or other means prior to including the role that had this dependency.
However, in most cases, this is a little too complicated.
Why do munin machines in your infrastructure only sometimes have Apache available?
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgzund%2BCfte7iYWB4f6ZD9GUnOkNpszk4jk6C7cR%2BD-wZA%40mail.gmail.com.