On 01.09.2018 04:14, Tim Uckun wrote:
> I don't think I explained myself very well. Let me see if I can try
> again
> with a specific example.
Probably not, Julian did answer part of your question.
But code and/or examples is always welcome.
Since you are learning Ansible I would forget about symlinking and just
do it the "Ansible way".
Put everything in one or more roles, all files goes in the files
directory in the role.
In Ansible you create three lists, Mac exclusive list, Linux exclusive
list and a shared list.
Then you need three Ansible copy module tasks and the when: part Julian
showed you to make sure the correct list is run on the correct OS.
You need one for the Mac exclusive list, one for Linux exclusive list
and one task for the shared one.
A task looks something like this:
- name: copy out mac bins
copy:
src: '{{ item }}'
dest: '{{ ansible_env.HOME }}/bin/'
mode: 0755
with_items: '{{ mac-exclusive-list }}'
when: ansible_os_family == 'Darwin'
This is one way to do it, there are others, some even more compact, but
you learn about these methods as you come more familiar with Ansible.
--
Kai Stian Olstad