add ghost update task

This commit is contained in:
Gabriel Augendre 2024-10-11 01:20:02 +02:00
parent 2ae07de7ca
commit 49150e0339

View file

@ -0,0 +1,53 @@
---
- name: Ghost update
hosts: servers
gather_facts: false
tasks:
- name: Start update on gabnotes.org
ansible.builtin.command:
chdir: /mnt/data/gabnotes.org
cmd: ghost update
register: gabnotes_async
changed_when: true
async: 300
poll: 0
- name: Start update on voyages-lois.augendre.info
ansible.builtin.command:
chdir: /mnt/data/voyages-lois.augendre.info
cmd: ghost update
register: voyages_lois_async
changed_when: true
async: 300
poll: 0
- name: Start update on voyages.coccomagnard.fr
ansible.builtin.command:
chdir: /mnt/data/voyages.coccomagnard.fr
cmd: ghost update
register: voyages_coccomagnard_async
changed_when: true
async: 300
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
ansible.builtin.async_status:
jid: "{{ voyages_lois_async.ansible_job_id }}"
register: voyages_lois
until: voyages_lois.finished
changed_when: '"Restarting Ghost" in voyages_lois.stdout'
retries: 100
delay: 10
- name: Check voyages.coccomagnard.fr
ansible.builtin.async_status:
jid: "{{ voyages_coccomagnard_async.ansible_job_id }}"
register: voyages_coccomagnard
until: voyages_coccomagnard.finished
changed_when: '"Restarting Ghost" in voyages_coccomagnard.stdout'
retries: 100
delay: 10