Hi,
Another way:
- create symlinks (either for whole roles directory or just specific roles inside it) (it is not nice, but it could get your job done for now)
A configuration option and environment variable t specify a list of paths where to search for roles will probably be needed someday.
I am wondering if it is possible to create a generic path lookup function that could be used all over the place and always behave in the expected way/order. A function that would use the same approach everywhere:
- locate the role: first check if absolute path, than check in "roles" dir relative to playbook (also recurse through all parents), check in "roles" dir relative to inventory file, check in "roles" dir relative to all paths in configuration option or environment variable, as last resort check in "roles" dir relative to current dir, than repeat everything without "roles" dir
- same could be used for locating the module library and similar (replace "roles" with "library" in above)
- same could also be used for locating group_vars/host_vars, although only relative to main playbook or inventory file should be encouraged
- locate templates in template module, files in file module or file lookup plugin: first check if absolute path, than if lookup plugin used inside a template check relative to the template (?), than if inside a role check relative to its "templates"/"files" folder, than check in "templates"/"files" folder next to playbooks (recurse parents), check in "templates"/"files" folder next to the inventory file, check in "templates"/"files" relative to all paths in configuration option or environment variable, as last resort check in "templates"/"files" dir relative to current dir
To me it seems that using the same approach everywhere would be possible, or not?
Greetings,
gw
--
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.