fix ghost dependencies race condition

This commit is contained in:
Gabriel Augendre 2024-10-11 17:27:59 +02:00
parent 12eaa03650
commit 638574dd10

View file

@ -3,14 +3,13 @@
hosts: servers hosts: servers
gather_facts: false gather_facts: false
tasks: tasks:
- name: Start update on gabnotes.org # Run the first task synchronously to download dependencies.
- name: Update gabnotes.org
ansible.builtin.command: ansible.builtin.command:
chdir: /mnt/data/gabnotes.org chdir: /mnt/data/gabnotes.org
cmd: ghost update cmd: ghost update
register: gabnotes_async register: gabnotes
changed_when: false changed_when: '"Restarting Ghost" in gabnotes.stdout'
async: 300
poll: 0
- name: Start update on voyages-lois.augendre.info - name: Start update on voyages-lois.augendre.info
ansible.builtin.command: ansible.builtin.command:
chdir: /mnt/data/voyages-lois.augendre.info chdir: /mnt/data/voyages-lois.augendre.info
@ -27,14 +26,6 @@
changed_when: false changed_when: false
async: 300 async: 300
poll: 0 poll: 0
- name: Check gabnotes.org
ansible.builtin.async_status:
jid: "{{ gabnotes_async.ansible_job_id }}"
register: gabnotes
until: gabnotes.finished
changed_when: '"Restarting Ghost" in gabnotes.stdout'
retries: 100
delay: 10
- name: Check voyages-lois.augendre.info - name: Check voyages-lois.augendre.info
ansible.builtin.async_status: ansible.builtin.async_status:
jid: "{{ voyages_lois_async.ansible_job_id }}" jid: "{{ voyages_lois_async.ansible_job_id }}"