Several of our Ansible playbooks and rules install scripts that need to be run regularly, either on a schedule or triggered by changes to files. We can use systemd units for this purpose.
We can write our own Ansible code for creating, deleting and managing these units and copy it around wherever needed, but of course it would be nicer to use an existing module that others already maintain.
The standard systemd module doesn't support creating or deleting units. Ansible Galaxy finds several modules that may fit the bill, but frankly it's hard to see the wood for the trees.
if you use Ansible, how do you address this? Which approach do you recommend? Are you using a module and if you do, which one and why?
.servicefile into the right location, then use thesystemdmodule withdaemon_reload. Never used a module for this.systemdservice files are structured like INI files, to create service files from scratch theini_filemodule – Tweak settings in INI files module could be used. See in example or Ansible - Edit asystemdservice file.