Thank you for your reply. As I wrote, I've created a Python module. I now access files in "files" directory through absolute path, but I would like to be more flexible, staying in the role directory.
My question is: How do I write, in Python, access to a file in "files"directory"? On Monday, June 1, 2015 at 2:44:21 PM UTC+2, Шалыгин Константин wrote: > > Any file in files can used ai is, like > - name: Copy files > copy: src='my_file.yml' dest='/etc/' group='root' owner='root' mode= > '0644' > > If u catch some vars from thist yml, just place it on my_role/vars dir. > > > > On Monday, June 1, 2015 at 1:35:20 PM UTC+6, [email protected] wrote: >> >> Hello, >> >> I've created a role with its main task using my Python module that should >> access a yaml file located in files dir of the role: >> >> roles >> my_role >> tasks >> main.yml >> library >> my_module >> files >> my_file.yml >> >> From my_module (Python), how can I access my_file.yml without absolute >> path? I would like something as "files/my_file.yml", does this exists? >> >> -- 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/b8dc1366-0c5c-4c8a-a0de-8b23b6ec392b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
