Best Practices with Vars

Hi,

I am searching for the best way to supply vars to multiple ansible
tasks;
the vars are mostly based on the systems OS ( like the default config
directory beeing in /etc for Linux and in /usr/local/etc for FreeBSD)
so I am generating groups for each OS but they are not recognized

So i use

You also have {{playbook_dir}} but there is no 'project' concept in Ansible.

An approach I've used before is to define in 'group_vars/all.yml'
something like:

project_dir: '{{lookup("env", "MYPROJ")|default(playbook_dir)}}'