Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File lookup() relative to playbook

Tags:

ansible

I am currently using lookup() function in role tasks.yml to get input from files for shell commands.

Is there a way to make lookups relative to the playbook file (project root folder) instead of role itself? I'd rather store files on playbook level.

like image 752
Mikko Ohtamaa Avatar asked Aug 27 '14 08:08

Mikko Ohtamaa


1 Answers

lookup() starts looking up from the playbook directory by default.

If you are using it differently try using {{ playbook_dir }}\path\to\your\file.

Its one of the default ansible variables

like image 51
Zasz Avatar answered Oct 22 '22 21:10

Zasz