Let me describe what I mean. Let’s say I have the following variables defined somewhere:
users:
- name: “{{ ansible_user_id }}”
group: “{% if ansible_os_family|lower == ‘darwin’ %}staff{% else %}{{ ansible_user_id }}{% endif %}”
shell: “{{ executables.zsh }}”
template_home: “home/{{ ansible_user_id }}”
home: “{% if ansible_os_family|lower == ‘darwin’ %}/Users/{{ ansible_user_id }}{% else %}/home/{{ ansible_user_id }}{% endif %}”
github_username: dan - name: “jim”
group: “{% if ansible_os_family|lower == ‘darwin’ %}staff{% else %}{{ ansible_user_id }}{% endif %}”
shell: “{{ executables.zsh }}”
template_home: “home/jim”
home: “{% if ansible_os_family|lower == ‘darwin’ %}/Users/jim{% else %}/home/jim{% endif %}”
github_username: jim
Then a separate variables file for a group called “dotfiles”: