ansible/roles/delayed_job/tasks/main.yml in subspace-1.0.7 vs ansible/roles/delayed_job/tasks/main.yml in subspace-1.0.8

- old
+ new

@@ -2,19 +2,25 @@ - set_fact: delayed_job_installed="true" - name: Monit Stop All shell: monit stop all become: true + ignore_errors: yes + - name: Wait for monit to stop + shell: monit status | grep Monitored | wc -l | awk '{print $1 $2}' + register: monit_stopped + retries: 10 + until: monit_stopped.stdout == "0" + delay: 10 + become: true + - name: Install delayed_job monit script template: src: delayed-job-monit-rc dest: /etc/monit/conf.d/delayed_job_{{project_name}}_{{rails_env}} become: true - notify: - - reload_monit - - restart_monit - name: Remove old upstart files file: path: /etc/init/delayed-job.conf state: absent @@ -24,8 +30,16 @@ file: path: /etc/monit/conf.d/delayed_job state: absent become: true - - name: Monit Start All - shell: monit start all + - name: reload_monit + shell: monit reload + become: true + + - name: wait + pause: + seconds: 3 + + - name: restart_monit + shell: monit restart all become: true