--- - name: Install monit apt: name: monit state: present - name: Install delayed_job monit script template: src: delayed-job-monit-rc dest: /etc/monit/conf.d/delayed_job_{{project_name}}_{{rails_env}} notify: monit reload - name: Copy sudoers file so that deploy can restart services without entering password. copy: src: deploy-service dest: /etc/sudoers.d/deploy-service sudo: true - name: Copy monit config to enable http from localhost copy: src: monit-http.conf dest: /etc/monit/conf.d/monit-http.conf sudo: true notify: monit reload - name: Remove old upstart files file: path: /etc/init/delayed-job.conf state: absent - name: Remove old monit files file: path: /etc/monit/conf.d/delayed_job state: absent