Add async task for doom emacs sync
This commit is contained in:
parent
2d80cc1c7d
commit
539ecdea46
15
roles/config/tasks/async.yml
Normal file
15
roles/config/tasks/async.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Doom Emacs | Check if installed
|
||||
ansible.builtin.stat:
|
||||
path: "~/.config/emacs/bin/doom"
|
||||
register: doom_emacs
|
||||
tags: config
|
||||
|
||||
- name: Doom Emacs | Update if present - aync
|
||||
ansible.builtin.shell:
|
||||
cmd: "~/.config/emacs/bin/doom sync"
|
||||
when: doom_emacs.stat.exists
|
||||
async: 600
|
||||
poll: 0
|
||||
register: async_doom_emacs
|
||||
tags: config
|
13
roles/config/tasks/async_check.yml
Normal file
13
roles/config/tasks/async_check.yml
Normal file
@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Doom Emacs | Check on async job
|
||||
async_status:
|
||||
jid: "{{ async_doom_emacs.ansible_job_id }}"
|
||||
register: job_result
|
||||
until: job_result.finished
|
||||
retries: 60
|
||||
delay: 10
|
||||
|
||||
- name: Doom Emacs | Cleanup async job
|
||||
async_status:
|
||||
jid: "{{ async_doom_emacs.ansible_job_id }}"
|
||||
mode: cleanup
|
@ -112,6 +112,12 @@
|
||||
mode: "0755"
|
||||
tags: config
|
||||
|
||||
# Start async tasks early
|
||||
- name: Import Tasks from async.yml
|
||||
ansible.builtin.import_tasks:
|
||||
file: async.yml
|
||||
tags: config
|
||||
|
||||
- name: Reload system systemd services
|
||||
ansible.builtin.systemd_service:
|
||||
daemon_reload: true
|
||||
@ -303,19 +309,13 @@
|
||||
cmd: "update-desktop-database ~/.local/share/applications/"
|
||||
tags: config
|
||||
|
||||
- name: Doom Emacs | Check if installed
|
||||
ansible.builtin.stat:
|
||||
path: "~/.config/emacs/bin/doom"
|
||||
register: doom_emacs
|
||||
tags: config
|
||||
|
||||
- name: Doom Emacs | Update if present
|
||||
ansible.builtin.shell:
|
||||
cmd: "~/.config/emacs/bin/doom sync"
|
||||
when: doom_emacs.stat.exists
|
||||
tags: config
|
||||
|
||||
- name: Import Tasks from plasma.yml
|
||||
ansible.builtin.import_tasks:
|
||||
file: plasma.yml
|
||||
tags: config
|
||||
|
||||
# Async task callbacks
|
||||
- name: Import Tasks from async_check.yml
|
||||
ansible.builtin.import_tasks:
|
||||
file: async_check.yml
|
||||
tags: config
|
||||
|
Loading…
Reference in New Issue
Block a user