@matteo-nunziati said in wetting my feet with CM software:
At that point if you have interleaved common/specific tasks you have to create a lot of fragmentation with all that includes and a number of "micro" files, or you end up duplicating code in files to have less fragmentation...
How is that any different than if/else statements?
if == ubuntu
package=apache2
else
package=httpd
when: ansible_os_family == "Debian"
pkg = apache2
when: ansible_os_family == "RedHat"
pkg = httpd
You don't need mico files at all. Just call variables in your j2 templates depending on the OS or OS release. Say for instance you use port 22 on RHEL and 2222 on Ubuntu (stupid but just an example), use the same j2 file with a {{ ssh_port }} variable and have the task insert the port number. No need for anything else other than a single template file.