- name: set service name base set_fact: touch_file_service_name_base: "touch-file-{{ file|replace('/', '-') }}" - name: create touch-file.service template: src=touch-file.service.j2 dest=/etc/systemd/system/{{ touch_file_service_name_base }}.service notify: systemd-daemon-reload - name: create touch-file.timer template: src=touch-file.timer.j2 dest=/etc/systemd/system/{{ touch_file_service_name_base }}.timer notify: systemd-daemon-reload - name: enable touch-file.timer service: name={{ touch_file_service_name_base }}.timer state=started enabled=yes