Is it possible to / how would one include vars files from other vars files?
Why not? I do this all the time in roles/whatever/tasks/main.yml
with include_vars:
- include_vars: whatever_os_{{ ansible_distribution }}_{{ ansible_distribution_major_version }}.yml
The variables are loaded from the vars
directory of the role. In a playbook the path is relative to the playbook, or you can use an absolute path.
In the case of the above, I then have OS-specific variables in these files:
$ ls -l roles/whatever/vars
total 48
lrwxrwxrwx. 1 error error 24 Feb 2 21:56 whatever_os_CentOS_5.yml -> whatever_os_RedHat_5.yml
lrwxrwxrwx. 1 error error 24 Feb 2 21:56 whatever_os_CentOS_6.yml -> whatever_os_RedHat_6.yml
lrwxrwxrwx. 1 error error 24 Feb 2 21:56 whatever_os_CentOS_7.yml -> whatever_os_RedHat_7.yml
-rw-rw-r--. 1 error error 81 May 9 23:17 whatever_os_Debian_6.yml
-rw-rw-r--. 1 error error 81 May 9 23:17 whatever_os_Debian_7.yml
-rw-rw-r--. 1 error error 81 May 9 23:17 whatever_os_Debian_8.yml
-rw-r--r--. 1 error error 173 Apr 28 14:59 whatever_os_Fedora_20.yml
-rw-r--r--. 1 error error 173 Mar 22 01:51 whatever_os_Fedora_21.yml
-rw-r--r--. 1 error error 173 May 9 23:18 whatever_os_Fedora_22.yml
-rw-r--r--. 1 error error 188 Mar 22 01:51 whatever_os_RedHat_5.yml
-rw-r--r--. 1 error error 191 Mar 22 01:51 whatever_os_RedHat_6.yml
-rw-r--r--. 1 error error 189 Mar 22 01:51 whatever_os_RedHat_7.yml
-rw-rw-r--. 1 error error 81 May 9 23:17 whatever_os_Ubuntu_10.yml
-rw-rw-r--. 1 error error 81 May 9 23:17 whatever_os_Ubuntu_12.yml
-rw-rw-r--. 1 error error 81 May 9 23:17 whatever_os_Ubuntu_14.yml