- name: "create {{heal_docker}}"
  file:
    path: "{{heal_docker}}"
    state: directory
    mode: 0755
  when: run_once_heal_docker is not defined

- name: create heal-docker.py
  copy:
    src: heal-docker.py
    dest: "{{heal_docker}}heal-docker.py"
  notify: restart heal-docker.cymais.service
  when: run_once_heal_docker is not defined

- name: create heal-docker.cymais.service
  template: 
    src: heal-docker.service.j2 
    dest: /etc/systemd/system/heal-docker.cymais.service
  notify: restart heal-docker.cymais.service
  when: run_once_heal_docker is not defined

- name: set service_name to the name of the current role
  set_fact:
    service_name: "{{ role_name }}"
  when: run_once_heal_docker is not defined

- name: "include role for systemd-timer for {{service_name}}"
  include_role:
    name: systemd-timer
  vars:
    on_calendar:  "{{on_calendar_heal_docker}}"
  when: run_once_heal_docker is not defined

- name: run the heal_docker tasks once
  set_fact:
    run_once_heal_docker: true
  when: run_once_heal_docker is not defined