Files
ansible/roles/mac/tasks/hermes-cron.yml
T
PhilandClaude Opus 5.5 2d23b9c470 Mac: weekly Hermes update notice on Telegram
Hermes has no auto-update for itself, and /update from Telegram can leave
a launchd gateway offline. Instead, a no-agent Hermes cron job runs
`hermes update --check` on Mondays at 09:07 and messages Telegram only when
a new stable release is out (a failing check sends an error alert).

Adds hermes_cron_jobs (scripts in files/hermes-scripts/, copied to
~/.hermes/scripts/; jobs created when missing) so the deal checker can
follow the same pattern.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 06:59:37 -07:00

28 lines
976 B
YAML

- name: Hermes cron scripts
ansible.builtin.copy:
src: "hermes-scripts/{{ item.script }}"
dest: "{{ ansible_user_dir }}/.hermes/scripts/"
mode: "0700"
loop: "{{ hermes_cron_jobs | selectattr('script', 'defined') }}"
loop_control:
label: "{{ item.script }}"
- name: List Hermes cron jobs
ansible.builtin.command:
argv: ["{{ hermes_cli }}", cron, list, --all]
register: hermes_cron_list
changed_when: false
check_mode: false
- name: Create missing Hermes cron jobs
ansible.builtin.command:
argv: >-
{{ [hermes_cli, 'cron', 'create', item.schedule, '--name', item.name, '--deliver', item.deliver]
+ (['--script', item.script] if item.script is defined else [])
+ (['--no-agent'] if item.no_agent | default(false) else [])
+ ([item.prompt] if item.prompt is defined else []) }}
loop: "{{ hermes_cron_jobs }}"
loop_control:
label: "{{ item.name }}"
when: item.name not in hermes_cron_list.stdout