- name: "create {{ health_msmtp_folder }}"
  file:
    path: "{{ health_msmtp_folder }}"
    state: directory
    mode: 0755

- name: create health-msmtp.sh
  template:
    src:  health-msmtp.sh.j2
    dest: "{{ health_msmtp_folder }}health-msmtp.sh"
    mode: '0755'

- name: create health-msmtp.cymais.service
  template:
    src: health-msmtp.service.j2
    dest: /etc/systemd/system/health-msmtp.cymais.service
  notify: reload health-msmtp.cymais.service

- name: set service_name to the name of the current role
  set_fact:
    service_name: "{{ role_name }}"

- name: include role for systemd-timer for {{ service_name }}
  include_role:
    name: systemd-timer
  vars:
    on_calendar: "{{ on_calendar_health_msmtp }}"