Add lifecycle flags for AI desktop applications

Manage ChatGPT Desktop, OpenCode Desktop, and Cline Desktop with the same install/uninstall lifecycle pattern used by the CLI coding agents: independent flags per app, a shared ai_desktop_apps map, a common pre-task that rejects conflicting install/uninstall pairs, and explicit install and removal task flows.

ChatGPT opts in per host through chatgpt_desktop_install_enabled, Cline opts in through the desktop_gnome group vars, and OpenCode Desktop keeps removal selected so the retired opencode RPM and every cached download converge away on graphical hosts. Removal never touches user data, GNOME favorites, or the npm-managed CLI counterparts.
This commit is contained in:
2026-11-08 22:02:17 +01:00
parent ccb4a0daa6
commit f09a708fe9
12 changed files with 316 additions and 67 deletions

View File

@@ -56,6 +56,7 @@ Ansible-driven personal infrastructure repo for Fedora and Void desktops, Fedora
- Focused checks: - Focused checks:
- Emacs is disabled by default; temporary Emacs check: `ansible-playbook ansible/site.yml --limit <host> --tags emacs --check --diff -e emacs_enabled=true` - Emacs is disabled by default; temporary Emacs check: `ansible-playbook ansible/site.yml --limit <host> --tags emacs --check --diff -e emacs_enabled=true`
- AI coding agents: `ansible-playbook ansible/site.yml --limit <host> --tags ai_agents --check --diff` - AI coding agents: `ansible-playbook ansible/site.yml --limit <host> --tags ai_agents --check --diff`
- AI desktop apps lifecycle: `ansible-playbook ansible/site.yml --limit ikaros --tags chatgpt,opencode_desktop,cline_desktop --check --diff`
- Mail bootstrap: `sh -n scripts/bootstrap_mail.sh` and `shellcheck scripts/bootstrap_mail.sh` - Mail bootstrap: `sh -n scripts/bootstrap_mail.sh` and `shellcheck scripts/bootstrap_mail.sh`
- Thunderbird iCloud profile: `ansible-playbook ansible/site.yml --limit ikaros --tags thunderbird --check --diff` - Thunderbird iCloud profile: `ansible-playbook ansible/site.yml --limit ikaros --tags thunderbird --check --diff`
- Server NPM Quadlet: `systemctl status prometheus-npm.service`; the Compose fallback is retired. - Server NPM Quadlet: `systemctl status prometheus-npm.service`; the Compose fallback is retired.
@@ -551,6 +552,9 @@ validated exports of older historical data will use a dedicated Atlas NFS datase
- `dotfiles_common` deploys `ai_agents_dotfiles` and renders `ai_agents_templates` only when deployment is enabled. - `dotfiles_common` deploys `ai_agents_dotfiles` and renders `ai_agents_templates` only when deployment is enabled.
- Removal is limited to the managed npm packages and `/usr/local/bin/bob`; never remove agent dotfiles, instructions, credentials, or user data. - Removal is limited to the managed npm packages and `/usr/local/bin/bob`; never remove agent dotfiles, instructions, credentials, or user data.
- Keep `.config/ai/` as the common instruction source; update agent-specific entrypoints to reference it rather than duplicating instruction text. - Keep `.config/ai/` as the common instruction source; update agent-specific entrypoints to reference it rather than duplicating instruction text.
- Fedora desktop AI apps (`chatgpt_desktop`, `opencode_desktop`, `cline_desktop`) follow the same lifecycle pattern through `ai_desktop_apps` in `ansible/inventory/group_vars/fedora.yml`; `install_enabled` and `uninstall_enabled` are independent per app and mutually exclusive (enforced by the common pre-task).
- ChatGPT opts in per host (`ikaros`, `nymph`); Cline opts in through `desktop_gnome` group vars; OpenCode Desktop keeps removal selected by default because Cline replaced it.
- Desktop-app removal deletes only managed artifacts: the RPM package (`chatgpt`, `opencode`, `cline`), ChatGPT's managed repository and signing key, and every cached download; it never removes user data, GNOME favorites, or the npm-managed CLI counterparts.
## Tooling Notes ## Tooling Notes
- Install local tooling with: - Install local tooling with:

View File

@@ -63,9 +63,11 @@ nymph is allowed to break
`ikaros` is the stable personal Fedora/GNOME desktop. `nymph` is the laptop and gets the same shared desktop dotfiles while GNOME itself stays close to the Fedora defaults. The legacy `void` and `desktop` groups are compatibility parents; the main axes are `platform_*`, `role_*`, and `desktop_*`. `ikaros` is the stable personal Fedora/GNOME desktop. `nymph` is the laptop and gets the same shared desktop dotfiles while GNOME itself stays close to the Fedora defaults. The legacy `void` and `desktop` groups are compatibility parents; the main axes are `platform_*`, `role_*`, and `desktop_*`.
The official ChatGPT desktop RPM is enabled only on `ikaros` and `nymph`. The The official ChatGPT desktop RPM is installed only on `ikaros` and `nymph`
playbook configures OpenAI's signed RPM repository and imports its pinned RPM through their `chatgpt_desktop_install_enabled` host overrides. The playbook
signing key before installation; subsequent updates are handled by DNF. configures OpenAI's signed RPM repository and imports its pinned RPM signing
key before installation; subsequent updates are handled by DNF. Enabling
`chatgpt_desktop_uninstall_enabled` removes the package, repository, and key.
## Deferred planned node: Cerberus ## Deferred planned node: Cerberus
@@ -620,6 +622,26 @@ only in the entry for the agent being removed, then run:
ansible-playbook ansible/site.yml --limit deadalus --tags ai_agents --check --diff ansible-playbook ansible/site.yml --limit deadalus --tags ai_agents --check --diff
``` ```
### AI desktop applications
The same lifecycle-flag pattern manages the Fedora desktop applications
through `ai_desktop_apps` in `ansible/inventory/group_vars/fedora.yml`.
`chatgpt_desktop`, `opencode_desktop` and `cline_desktop` each expose
`install_enabled` and `uninstall_enabled`, and the common pre-task rejects
both being true for the same app. ChatGPT opts in per host (`ikaros`, `nymph`),
Cline opts in through `desktop_gnome` group vars, and OpenCode Desktop keeps
removal selected because Cline replaced it.
Removal deletes only what the playbook manages — the installed RPM package,
ChatGPT's managed repository and signing key, and every cached download — and
leaves GNOME favorites, user data, and the npm-managed CLI counterparts
untouched. To switch an app between installed and removed, flip exactly one
of its lifecycle flags, then preview with:
```bash
ansible-playbook ansible/site.yml --limit ikaros --tags chatgpt,opencode_desktop,cline_desktop --check --diff
```
### Cline Desktop on Fedora ### Cline Desktop on Fedora
The [official Cline Desktop RPM](https://cline.bot/desktop) is managed on the The [official Cline Desktop RPM](https://cline.bot/desktop) is managed on the
@@ -643,9 +665,11 @@ ansible-playbook ansible/site.yml --limit ikaros --tags cline_desktop -K
Run locally on each workstation (`ansible_connection: local`); use `--limit nymph` Run locally on each workstation (`ansible_connection: local`); use `--limit nymph`
on the laptop. With a cold RPM cache, check mode reports that dependency resolution on the laptop. With a cold RPM cache, check mode reports that dependency resolution
is not validated; the real run downloads, verifies, and installs the package. is not validated; the real run downloads, verifies, and installs the package.
Once Cline is installed, any previously installed OpenCode Desktop RPM can be Cline replaced OpenCode Desktop: its `ai_desktop_apps` entry keeps
retired once with `sudo rpm -e opencode`. This does not remove the npm CLI or `opencode_desktop_uninstall_enabled: true` by default, so a previously
user data; package removal is not part of ongoing convergence. installed `opencode` RPM converges away on graphical hosts. Flip the entry's
flags to reinstall the pinned release instead. Neither removal touches the
npm CLI or user data.
### Thunderbird iCloud profile on Fedora ### Thunderbird iCloud profile on Fedora

View File

@@ -4,8 +4,9 @@ desktop_environment: gnome
desktop_sessions_enabled: [] desktop_sessions_enabled: []
desktop_default_session: gnome desktop_default_session: gnome
emacs_enabled: true emacs_enabled: true
cline_desktop_enabled: true # Cline Desktop is installed (and pinned in the GNOME favorites) on every
cline_desktop_launcher: Cline.desktop # GNOME host; set cline_desktop_uninstall_enabled here to remove it instead.
cline_desktop_install_enabled: true
# Fedora Workstation/GNOME desktop applications. Keep this profile separate from # Fedora Workstation/GNOME desktop applications. Keep this profile separate from
# workstation_* so nymph can remain a desktop laptop rather than a dev workstation. # workstation_* so nymph can remain a desktop laptop rather than a dev workstation.

View File

@@ -64,6 +64,9 @@ fedora_flatpak_remote_name: flathub
fedora_flatpak_remote_url: https://dl.flathub.org/repo/flathub.flatpakrepo fedora_flatpak_remote_url: https://dl.flathub.org/repo/flathub.flatpakrepo
cline_desktop_version: "0.0.49" cline_desktop_version: "0.0.49"
# Launcher file shipped by the pinned RPM; the GNOME profile pins it in the
# favorites while installation stays enabled.
cline_desktop_launcher: Cline.desktop
# Digests published with the official GitHub release; update with the version. # Digests published with the official GitHub release; update with the version.
cline_desktop_rpm_checksums: cline_desktop_rpm_checksums:
x86_64: sha256:e10036a036ee531451695559e2c96feceb3d621408a6615bdd708ffcf9e778ab x86_64: sha256:e10036a036ee531451695559e2c96feceb3d621408a6615bdd708ffcf9e778ab
@@ -72,7 +75,38 @@ cline_desktop_rpm_url: >-
https://github.com/cline/cline/releases/download/desktop-v{{ cline_desktop_version }}/Cline_{{ cline_desktop_version }}_{{ ansible_facts['architecture'] }}.rpm https://github.com/cline/cline/releases/download/desktop-v{{ cline_desktop_version }}/Cline_{{ cline_desktop_version }}_{{ ansible_facts['architecture'] }}.rpm
cline_desktop_rpm_path: "/var/cache/cline-desktop-{{ cline_desktop_version }}-{{ ansible_facts['architecture'] }}.rpm" cline_desktop_rpm_path: "/var/cache/cline-desktop-{{ cline_desktop_version }}-{{ ansible_facts['architecture'] }}.rpm"
chatgpt_desktop_enabled: false # OpenCode Desktop was replaced by Cline Desktop. The pinned release stays
# available for reinstall, while removal is selected in the lifecycle flags
# below so leftovers from the switch converge away on graphical hosts.
opencode_desktop_version: "2.2.5"
# Digests published with the official GitHub release; update with the version.
opencode_desktop_rpm_checksums:
x86_64: sha256:4feb27fe98df9b7579abd31a790d331e9aff87c95f67081beefa2aaaa76ebada
aarch64: sha256:e84b1e03e2b4fb337ddfe015b6457a7aa0dfe171338be08e643ad66b1657033a
opencode_desktop_rpm_url: >-
https://github.com/anomalyco/opencode/releases/download/v{{ opencode_desktop_version }}/opencode-desktop-linux-{{ ansible_facts['architecture'] }}.rpm
opencode_desktop_rpm_path: "/var/cache/opencode-desktop-{{ opencode_desktop_version }}-{{ ansible_facts['architecture'] }}.rpm"
# AI desktop-app lifecycle controls are independent for every app and mirror
# the CLI coding-agent flags. Installation and removal are mutually exclusive
# per app; the common pre-task enforces this before any changes are made.
# ChatGPT opts in per host, Cline opts in through desktop_gnome group vars.
chatgpt_desktop_install_enabled: false
chatgpt_desktop_uninstall_enabled: false
opencode_desktop_install_enabled: false
opencode_desktop_uninstall_enabled: true
ai_desktop_apps:
chatgpt_desktop:
install_enabled: "{{ chatgpt_desktop_install_enabled }}"
uninstall_enabled: "{{ chatgpt_desktop_uninstall_enabled }}"
opencode_desktop:
install_enabled: "{{ opencode_desktop_install_enabled }}"
uninstall_enabled: "{{ opencode_desktop_uninstall_enabled }}"
cline_desktop:
install_enabled: "{{ cline_desktop_install_enabled | default(false) }}"
uninstall_enabled: "{{ cline_desktop_uninstall_enabled | default(false) }}"
chatgpt_desktop_supported_fedora_versions: chatgpt_desktop_supported_fedora_versions:
- "43" - "43"
- "44" - "44"

View File

@@ -6,7 +6,7 @@ codex_relay_uninstall_enabled: true
gemini_cli_install_enabled: false gemini_cli_install_enabled: false
gemini_cli_deploy_enabled: false gemini_cli_deploy_enabled: false
gemini_cli_uninstall_enabled: true gemini_cli_uninstall_enabled: true
chatgpt_desktop_enabled: true chatgpt_desktop_install_enabled: true
desktop_ai_media_enabled: true desktop_ai_media_enabled: true
desktop_ai_media_external_storage_enabled: true desktop_ai_media_external_storage_enabled: true
desktop_ai_media_external_luks_uuid: 6948c504-2d60-4cc8-9e7f-3ccdf28e80d7 desktop_ai_media_external_luks_uuid: 6948c504-2d60-4cc8-9e7f-3ccdf28e80d7

View File

@@ -7,7 +7,7 @@ gemini_cli_install_enabled: false
gemini_cli_deploy_enabled: false gemini_cli_deploy_enabled: false
gemini_cli_uninstall_enabled: true gemini_cli_uninstall_enabled: true
chatgpt_desktop_enabled: true chatgpt_desktop_install_enabled: true
# Fedora Workstation/GNOME laptop target. GNOME is provided by the base Fedora # Fedora Workstation/GNOME laptop target. GNOME is provided by the base Fedora
# Workstation install; Ansible deploys shared desktop dotfiles but leaves GNOME # Workstation install; Ansible deploys shared desktop dotfiles but leaves GNOME

View File

@@ -0,0 +1,92 @@
---
# ChatGPT desktop is installed from OpenAI's signed RPM repository; removal
# must clean up the package, the managed repository and its signing key.
- name: Validate ChatGPT desktop architecture on Fedora
tags: [packages, chatgpt]
ansible.builtin.assert:
that:
- ansible_facts['architecture'] in chatgpt_desktop_supported_architectures
- ansible_facts['distribution_major_version'] in chatgpt_desktop_supported_fedora_versions
fail_msg: >-
ChatGPT desktop supports Fedora {{ chatgpt_desktop_supported_fedora_versions | join(' and ') }}
on x86_64 or aarch64; detected Fedora {{ ansible_facts['distribution_major_version'] }}
on {{ ansible_facts['architecture'] }}.
when: chatgpt_desktop_install_enabled | default(false) | bool
- name: Install ChatGPT desktop RPM signing key
tags: [packages, chatgpt]
ansible.builtin.copy:
src: "{{ chatgpt_desktop_rpm_gpg_key }}"
dest: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
owner: root
group: root
mode: "0644"
when: chatgpt_desktop_install_enabled | default(false) | bool
- name: Import ChatGPT desktop RPM signing key
tags: [packages, chatgpt]
ansible.builtin.rpm_key:
state: present
key: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
when: chatgpt_desktop_install_enabled | default(false) | bool
- name: Configure ChatGPT desktop RPM repository
tags: [packages, chatgpt]
ansible.builtin.yum_repository:
name: openai-chatgpt
description: ChatGPT
baseurl: "{{ chatgpt_desktop_rpm_repository }}"
enabled: true
gpgcheck: true
repo_gpgcheck: true
gpgkey: "file:///etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
state: present
when: chatgpt_desktop_install_enabled | default(false) | bool
- name: Install ChatGPT desktop on selected Fedora hosts
tags: [packages, chatgpt]
ansible.builtin.dnf:
name: chatgpt
state: latest
update_cache: true
when: chatgpt_desktop_install_enabled | default(false) | bool
- name: Check for the installed ChatGPT desktop signing key
tags: [packages, chatgpt]
ansible.builtin.stat:
path: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
get_checksum: false
register: chatgpt_desktop_signing_key
when: chatgpt_desktop_uninstall_enabled | default(false) | bool
- name: Remove ChatGPT desktop from selected Fedora hosts
tags: [packages, chatgpt]
ansible.builtin.dnf:
name: chatgpt
state: absent
when: chatgpt_desktop_uninstall_enabled | default(false) | bool
- name: Remove ChatGPT desktop RPM repository
tags: [packages, chatgpt]
ansible.builtin.yum_repository:
name: openai-chatgpt
state: absent
when: chatgpt_desktop_uninstall_enabled | default(false) | bool
# rpm_key reads the identifier from the key file, so only remove the key from
# the RPM database while the deployed file is still present.
- name: Remove ChatGPT desktop RPM signing key from the RPM database
tags: [packages, chatgpt]
ansible.builtin.rpm_key:
state: absent
key: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
when:
- chatgpt_desktop_uninstall_enabled | default(false) | bool
- chatgpt_desktop_signing_key.stat.exists | default(false)
- name: Remove ChatGPT desktop RPM signing key file
tags: [packages, chatgpt]
ansible.builtin.file:
path: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
state: absent
when: chatgpt_desktop_uninstall_enabled | default(false) | bool

View File

@@ -1,10 +1,14 @@
--- ---
# Cline Desktop ships unsigned RPMs from its GitHub releases; only the
# checksum-verified download makes the local installation trustworthy.
- name: Validate Cline Desktop architecture on Fedora - name: Validate Cline Desktop architecture on Fedora
ansible.builtin.assert: ansible.builtin.assert:
that: that:
- ansible_facts['architecture'] in cline_desktop_rpm_checksums - ansible_facts['architecture'] in cline_desktop_rpm_checksums
fail_msg: "No verified Cline Desktop RPM for {{ ansible_facts['architecture'] }}." fail_msg: "No verified Cline Desktop RPM for {{ ansible_facts['architecture'] }}."
when: cline_desktop_install_enabled | default(false) | bool
# Runs for both flows so the register below is always valid.
- name: Check for cached Cline Desktop RPM - name: Check for cached Cline Desktop RPM
ansible.builtin.stat: ansible.builtin.stat:
path: "{{ cline_desktop_rpm_path }}" path: "{{ cline_desktop_rpm_path }}"
@@ -20,7 +24,9 @@
group: root group: root
mode: "0644" mode: "0644"
# get_url only sends HEAD in check mode and cannot populate a cold cache. # get_url only sends HEAD in check mode and cannot populate a cold cache.
when: not ansible_check_mode when:
- cline_desktop_install_enabled | default(false) | bool
- not ansible_check_mode
- name: Install Cline Desktop on Fedora - name: Install Cline Desktop on Fedora
ansible.builtin.dnf: ansible.builtin.dnf:
@@ -29,7 +35,10 @@
# Upstream ships an unsigned RPM. The download above verifies its pinned # Upstream ships an unsigned RPM. The download above verifies its pinned
# SHA-256; do not disable signature checks in system repository settings. # SHA-256; do not disable signature checks in system repository settings.
disable_gpg_check: true disable_gpg_check: true
when: not ansible_check_mode or cline_desktop_rpm_cache.stat.exists when:
- cline_desktop_install_enabled | default(false) | bool
- not ansible_check_mode
or cline_desktop_rpm_cache.stat.exists
- name: Explain Cline Desktop cold-cache check-mode limitation - name: Explain Cline Desktop cold-cache check-mode limitation
ansible.builtin.debug: ansible.builtin.debug:
@@ -38,5 +47,32 @@
{{ cline_desktop_version }} before ensuring it is installed. {{ cline_desktop_version }} before ensuring it is installed.
The RPM is not cached, so this dry run cannot validate DNF dependencies. The RPM is not cached, so this dry run cannot validate DNF dependencies.
when: when:
- cline_desktop_install_enabled | default(false) | bool
- ansible_check_mode - ansible_check_mode
- not cline_desktop_rpm_cache.stat.exists - not cline_desktop_rpm_cache.stat.exists
# The `cline` RPM package name is verified from the pinned release header;
# removal never touches the npm-managed cline CLI or user data.
- name: Remove Cline Desktop from Fedora
ansible.builtin.dnf:
name: cline
state: absent
when: cline_desktop_uninstall_enabled | default(false) | bool
# Clean every cached download so retirement also removes outdated pins.
- name: Find cached Cline Desktop RPM downloads
ansible.builtin.find:
paths: /var/cache
patterns: "cline-desktop-*.rpm"
file_type: file
register: cline_desktop_cached_rpms
when: cline_desktop_uninstall_enabled | default(false) | bool
- name: Remove cached Cline Desktop RPM downloads
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ cline_desktop_cached_rpms.files | default([]) }}"
loop_control:
label: "{{ item.path }}"
when: cline_desktop_uninstall_enabled | default(false) | bool

View File

@@ -168,62 +168,29 @@
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
- name: Manage Cline Desktop on Fedora GNOME workstations - name: Manage ChatGPT desktop lifecycle on Fedora graphical hosts
tags: [packages, chatgpt]
ansible.builtin.import_tasks: chatgpt_desktop.yml
when:
- "'graphical_desktop' in group_names"
- chatgpt_desktop_install_enabled | default(false) | bool
or chatgpt_desktop_uninstall_enabled | default(false) | bool
- name: Manage OpenCode Desktop lifecycle on Fedora graphical hosts
tags: [packages, opencode_desktop]
ansible.builtin.import_tasks: opencode_desktop.yml
when:
- "'graphical_desktop' in group_names"
- opencode_desktop_install_enabled | default(false) | bool
or opencode_desktop_uninstall_enabled | default(false) | bool
- name: Manage Cline Desktop lifecycle on Fedora graphical hosts
tags: [packages, cline_desktop] tags: [packages, cline_desktop]
ansible.builtin.import_tasks: cline_desktop.yml ansible.builtin.import_tasks: cline_desktop.yml
when: when:
- "'desktop_gnome' in group_names" - "'graphical_desktop' in group_names"
- cline_desktop_enabled | default(false) | bool - cline_desktop_install_enabled | default(false) | bool
or cline_desktop_uninstall_enabled | default(false) | bool
- name: Validate ChatGPT desktop architecture on Fedora
tags: [packages, chatgpt]
ansible.builtin.assert:
that:
- ansible_facts['architecture'] in chatgpt_desktop_supported_architectures
- ansible_facts['distribution_major_version'] in chatgpt_desktop_supported_fedora_versions
fail_msg: >-
ChatGPT desktop supports Fedora {{ chatgpt_desktop_supported_fedora_versions | join(' and ') }}
on x86_64 or aarch64; detected Fedora {{ ansible_facts['distribution_major_version'] }}
on {{ ansible_facts['architecture'] }}.
when: chatgpt_desktop_enabled | bool
- name: Install ChatGPT desktop RPM signing key
tags: [packages, chatgpt]
ansible.builtin.copy:
src: "{{ chatgpt_desktop_rpm_gpg_key }}"
dest: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
owner: root
group: root
mode: "0644"
when: chatgpt_desktop_enabled | bool
- name: Import ChatGPT desktop RPM signing key
tags: [packages, chatgpt]
ansible.builtin.rpm_key:
state: present
key: "/etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
when: chatgpt_desktop_enabled | bool
- name: Configure ChatGPT desktop RPM repository
tags: [packages, chatgpt]
ansible.builtin.yum_repository:
name: openai-chatgpt
description: ChatGPT
baseurl: "{{ chatgpt_desktop_rpm_repository }}"
enabled: true
gpgcheck: true
repo_gpgcheck: true
gpgkey: "file:///etc/pki/rpm-gpg/{{ chatgpt_desktop_rpm_gpg_key }}"
state: present
when: chatgpt_desktop_enabled | bool
- name: Install ChatGPT desktop on selected Fedora hosts
tags: [packages, chatgpt]
ansible.builtin.dnf:
name: chatgpt
state: latest
update_cache: true
when: chatgpt_desktop_enabled | bool
- name: Define Fedora Flatpak applications - name: Define Fedora Flatpak applications
tags: [packages] tags: [packages]

View File

@@ -0,0 +1,78 @@
---
# OpenCode Desktop ships unsigned RPMs from its GitHub releases; only the
# checksum-verified download makes the local installation trustworthy.
- 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'] }}."
when: opencode_desktop_install_enabled | default(false) | bool
# Runs for both flows so the register below is always valid.
- 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:
- opencode_desktop_install_enabled | default(false) | bool
- 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:
- opencode_desktop_install_enabled | default(false) | bool
- 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:
- opencode_desktop_install_enabled | default(false) | bool
- ansible_check_mode
- not opencode_desktop_rpm_cache.stat.exists
# The `opencode` RPM package name is verified from the pinned release header;
# removal never touches the npm-managed opencode-ai CLI or user data.
- name: Remove OpenCode Desktop from Fedora
ansible.builtin.dnf:
name: opencode
state: absent
when: opencode_desktop_uninstall_enabled | default(false) | bool
# Clean every cached download so retirement also removes outdated pins.
- name: Find cached OpenCode Desktop RPM downloads
ansible.builtin.find:
paths: /var/cache
patterns: "opencode-desktop-*.rpm"
file_type: file
register: opencode_desktop_cached_rpms
when: opencode_desktop_uninstall_enabled | default(false) | bool
- name: Remove cached OpenCode Desktop RPM downloads
ansible.builtin.file:
path: "{{ item.path }}"
state: absent
loop: "{{ opencode_desktop_cached_rpms.files | default([]) }}"
loop_control:
label: "{{ item.path }}"
when: opencode_desktop_uninstall_enabled | default(false) | bool

View File

@@ -292,4 +292,4 @@
- name: Pin Cline Desktop in GNOME - name: Pin Cline Desktop in GNOME
tags: [cline_desktop] tags: [cline_desktop]
ansible.builtin.import_tasks: cline_desktop.yml ansible.builtin.import_tasks: cline_desktop.yml
when: cline_desktop_enabled | default(false) | bool when: cline_desktop_install_enabled | default(false) | bool

View File

@@ -33,6 +33,19 @@
loop_control: loop_control:
label: "{{ item.key }}" label: "{{ item.key }}"
- name: Reject conflicting AI desktop-app lifecycle flags
tags: [always, ai_desktop_apps]
ansible.builtin.assert:
that:
- not (item.value.install_enabled | default(false)
and item.value.uninstall_enabled | default(false) | bool)
fail_msg: >-
{{ item.key }} has both install_enabled and uninstall_enabled set to true.
Choose either installation or removal before running the playbook.
loop: "{{ ai_desktop_apps | default({}) | dict2items }}"
loop_control:
label: "{{ item.key }}"
roles: roles:
- role: dotfiles_common - role: dotfiles_common
when: when: