--- - name: Create hostfile become: yes template: src: usr/local/sbin/check-docker.j2 dest: /usr/local/sbin/check-docker - name: Remove file (delete file) become: yes file: path: /usr/local/sbin/check-docker.j2 state: absent - name: create cron become: yes cron: name: "check docker" minute: "*/15" job: "/usr/local/sbin/check-docker"