On Tue, 1 Jul 2014, Mikhail Koshelev wrote:

There's actually a way (hack?) to get role directory by using lookup.
Define 'role_dir' var as shown below and you can use it in your roles'
tasks files to refer to the current role directory:
role_dir: "{{ lookup('pipe','pwd')|dirname }}"

So this assumes that, when the role_dir variable is expanded, the current directory will be one inside the relevant role directory? That's not what I thought I saw, but perhaps I was wrong.

But if that *is* the case, surely I could use relative paths to construct paths to any other files in the role and bypass the need to run 'pwd'?

I fear I'm missing something...

Jon.

--
Jon Warbrick
Information Systems Manager, University of Cambridge Information Services

--
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/alpine.OSX.2.00.1407121338330.1232%40ramoth.brsn.invalid.
For more options, visit https://groups.google.com/d/optout.

Reply via email to