mirror of
https://github.com/fscotto/infra.git
synced 2026-11-26 05:39:52 +00:00
Add an opencode_desktop task file to packages_fedora that downloads the official RPM, verifies a pinned per-architecture SHA-256, and installs it with DNF. Upstream RPMs are unsigned, so only that task disables GPG checking; system repository signature policy is unchanged. Gate the tasks on graphical_desktop plus opencode_desktop_enabled, which desktop_gnome enables for ikaros and nymph. WSL, Fedora IoT, Void, and servers stay untouched, and the npm-managed OpenCode CLI keeps its own configuration and lifecycle flags. Pin version 2.2.5 with x86_64 and aarch64 digests, and document the opencode_desktop tag, the cold-cache check-mode limitation, and why the official download page must confirm the version.
43 lines
1.6 KiB
YAML
43 lines
1.6 KiB
YAML
---
|
|
- name: Validate OpenCode Desktop architecture on Fedora
|
|
ansible.builtin.assert:
|
|
that:
|
|
- ansible_facts['architecture'] in opencode_desktop_rpm_checksums
|
|
fail_msg: "No verified OpenCode Desktop RPM for {{ ansible_facts['architecture'] }}."
|
|
|
|
- name: Check for cached OpenCode Desktop RPM
|
|
ansible.builtin.stat:
|
|
path: "{{ opencode_desktop_rpm_path }}"
|
|
get_checksum: false
|
|
register: opencode_desktop_rpm_cache
|
|
|
|
- name: Download verified OpenCode Desktop RPM
|
|
ansible.builtin.get_url:
|
|
url: "{{ opencode_desktop_rpm_url }}"
|
|
dest: "{{ opencode_desktop_rpm_path }}"
|
|
checksum: "{{ opencode_desktop_rpm_checksums[ansible_facts['architecture']] }}"
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
# get_url only sends HEAD in check mode and cannot populate a cold cache.
|
|
when: not ansible_check_mode
|
|
|
|
- name: Install OpenCode Desktop on Fedora
|
|
ansible.builtin.dnf:
|
|
name: "{{ opencode_desktop_rpm_path }}"
|
|
state: present
|
|
# Upstream ships an unsigned RPM. The download above verifies its pinned
|
|
# SHA-256; do not disable signature checks in system repository settings.
|
|
disable_gpg_check: true
|
|
when: not ansible_check_mode or opencode_desktop_rpm_cache.stat.exists
|
|
|
|
- name: Explain OpenCode Desktop cold-cache check-mode limitation
|
|
ansible.builtin.debug:
|
|
msg: >-
|
|
A real run will download and SHA-256 verify OpenCode Desktop
|
|
{{ opencode_desktop_version }} before ensuring it is installed.
|
|
The RPM is not cached, so this dry run cannot validate DNF dependencies.
|
|
when:
|
|
- ansible_check_mode
|
|
- not opencode_desktop_rpm_cache.stat.exists
|