Hi,

2013/12/10 Dmitry Makovey <[email protected]>

> I have a situation where I have files locateed in /files (top-level) and
> would like to use them within certain roles to avoid duplication. However
> ansible tells me it can't find referenced   file. Do I need to turn a knob
> or should I just copy same files into diff roles  or for any common files
> create additional common roles?
>
you can reference files with inventory_dir like:
copy: src={{ inventory_dir }}/files/my_file

Assuming you always read from top level files and not from role files dir.
If you want to read from role or files depending on file existence look at
with_first_found:
http://www.ansibleworks.com/docs/playbooks_conditionals.html#selecting-files-and-templates-based-on-variables

David

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



-- 
David Karban
Specialista na správu linuxových serverů
www.karban.eu

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

Reply via email to