- name: Create override directories loop: "{{ systemd.overrides }}" file: follow: yes path: "/etc/systemd/system/{{ item }}.service.d/" state: directory when: (systemd.overrides| default([])) | length tags: - systemd - override - name: Copy service overrides loop: "{{ systemd.overrides }}" template: follow: yes src: "{{ item }}.service.j2" dest: "/etc/systemd/system/{{ item }}.service.d/override.conf" notify: - Reload daemon - Run service actions when: (systemd.overrides| default([])) | length tags: - systemd - override