I am using the following files/
organization for an Ansible project for src
files to copy onto target (my roles all follow this scheme):
files/{{ ansible_distribution }}/etc/modules-load.d/i915.conf
files/{{ ansible_distribution }}/{{ host }}/etc/modules-load.d/i2c-dev.conf
files/etc/modules-load.d/tcp-bbr.conf
...
A src
file belongs in any one of the the three directories above, respectively:
files/
files/{{ ansible_distribution }}/
files/{{ ansible_distribution }}/{{ host }}/
Files in the first directory is intended for all target hosts managed. The second directory describes its files as specific to the group and the third directory describes its files as specific to the host. I use this naming scheme because it is easy to determine similarities and differences between configs in different hosts/groups.
They represents /
on the target system, i.e. the target host should have the copied files to dest
as:
/etc/modules-load.d/i2c-dev.conf
/etc/modules-load.d/i915.conf
/etc/modules-load.d/tcp-bbr.conf
How to loop over files to copy source files to the destination without hardcoding source and intended destination paths for each file? It can assume that I won’t have both a version of e.g. i2c-dev.conf
under host-specific files/{{ ansible_distribution }}/{{ host }}/
and under the more general group/all variants of the same files that coul