I am trying to get my head around parsing a folder for its files and creating symlinks for those files found (depth 0) and place them in another directory.
Example: parse sites-available/ and create symlinks in sites-enabled/ with relative paths.
I know one can just use the command/shell modules or even create a task and register the result of a ‘ls’ command for example and then parse them… but what about the relative path?
One could also use a script like Apache provides for example: a2ensite but what about NGINX?
Trying now the ‘with_fileglob’ but the task just skips…
I would have a list of what sites to enable and what sites to disable centrally, and do this with a simple with_items instead, because it would be better to have a central record than to have potentially hundreds of different servers each being their own sources of record.
template: src={{ site }}.cfg dest=/path/to/sites-available
with_items: enable_sites