I don't understand what you are suggesting to implement, though this is
probably a good discussion for ansible-devel instead of the main list.

We would like to see what syntax you are proposing though it *sounds* like
you might be saying to search the various role dependency chain items to
find the first file up the chain starting at the current role.

Really, role deps shouldn't be looked at like inheritance though - they are
simply NOT inheritance.  They are things to do *first*.

It might be better to pass a parameter into the role instead (like you
have) with what filename to use, I'm unclear as to why you think it needs
an absolute path though.





On Tue, May 27, 2014 at 5:53 AM, Paul Oyston <[email protected]> wrote:

> Hi guys,
>
> I had a bit of an idea surrounding the template and file path for
> dependencies, wondering what everyone thinks of this.
>
> At the moment when you use meta/main.yml - dependencies the template path
> and file path is set to the role that you're running in. For example if you
> were to use a example.nginx role the template path would be something like
> /etc/ansible/roles/example.nginx/templates.
>
> When you're calling dependencies it's likely that you may want to override
> a template or pass a template in to the role. For example you may wish to
> do something like:
>
> # file: /etc/ansible/roles/example.app/meta/main.yml
> ---
> dependencies:
>   - role: example.nginx
>     server_template: server.conf.j2
>
>
> Where the server.conf.j2 file is contained within the example.app role. At
> the moment the only workaround to this is to use the absolute path which
> may not be very portable.
>
> # file: /etc/ansible/roles/example.app/meta/main.yml
> ---
> dependencies:
>   - role: example.nginx
>     server_template: /etc/ansible/roles/example.app/templates/server.conf.
> j2
>
> I don't mind implementing this feature myself if it's considered to be a
> good idea.
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/f4f5ca9c-fc82-4d55-a471-2f3cdee70f03%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/f4f5ca9c-fc82-4d55-a471-2f3cdee70f03%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgw-Mq52vpVRsSHWDrw9OZjNkQibjY0d8gpJcUoB10Wo%2BQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to