Replace OpenCode Desktop with Cline and add ecaas devcontainer setup

This commit is contained in:
2026-11-08 21:30:41 +01:00
parent 695fdf4711
commit ccb4a0daa6
19 changed files with 521 additions and 82 deletions

View File

@@ -0,0 +1,42 @@
---
- name: Validate Cline Desktop architecture on Fedora
ansible.builtin.assert:
that:
- ansible_facts['architecture'] in cline_desktop_rpm_checksums
fail_msg: "No verified Cline Desktop RPM for {{ ansible_facts['architecture'] }}."
- name: Check for cached Cline Desktop RPM
ansible.builtin.stat:
path: "{{ cline_desktop_rpm_path }}"
get_checksum: false
register: cline_desktop_rpm_cache
- name: Download verified Cline Desktop RPM
ansible.builtin.get_url:
url: "{{ cline_desktop_rpm_url }}"
dest: "{{ cline_desktop_rpm_path }}"
checksum: "{{ cline_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 Cline Desktop on Fedora
ansible.builtin.dnf:
name: "{{ cline_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 cline_desktop_rpm_cache.stat.exists
- name: Explain Cline Desktop cold-cache check-mode limitation
ansible.builtin.debug:
msg: >-
A real run will download and SHA-256 verify Cline Desktop
{{ cline_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 cline_desktop_rpm_cache.stat.exists

View File

@@ -168,12 +168,12 @@
loop_control:
label: "{{ item.key }}"
- name: Manage OpenCode Desktop on Fedora graphical workstations
tags: [packages, opencode_desktop]
ansible.builtin.import_tasks: opencode_desktop.yml
- name: Manage Cline Desktop on Fedora GNOME workstations
tags: [packages, cline_desktop]
ansible.builtin.import_tasks: cline_desktop.yml
when:
- "'graphical_desktop' in group_names"
- opencode_desktop_enabled | default(false) | bool
- "'desktop_gnome' in group_names"
- cline_desktop_enabled | default(false) | bool
- name: Validate ChatGPT desktop architecture on Fedora
tags: [packages, chatgpt]

View File

@@ -1,42 +0,0 @@
---
- 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

View File

@@ -0,0 +1,56 @@
---
- name: Find the installed Cline Desktop launcher
ansible.builtin.stat:
path: "/usr/share/applications/{{ cline_desktop_launcher }}"
get_checksum: false
register: cline_desktop_launcher_stat
- name: Verify Cline Desktop installed its expected launcher
ansible.builtin.assert:
that: cline_desktop_launcher_stat.stat.isreg | default(false)
fail_msg: "Cline Desktop did not install {{ cline_desktop_launcher }}."
when: not ansible_check_mode
- name: Find the GNOME account for the Cline favorite
ansible.builtin.getent:
database: passwd
key: "{{ username }}"
when: cline_desktop_launcher_stat.stat.isreg | default(false)
- name: Update only the Cline and OpenCode entries in GNOME favorites
become_user: "{{ username }}"
environment:
HOME: "{{ user_home }}"
XDG_RUNTIME_DIR: "/run/user/{{ ansible_facts.getent_passwd[username][1] }}"
DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ ansible_facts.getent_passwd[username][1] }}/bus"
when: cline_desktop_launcher_stat.stat.isreg | default(false)
block:
- name: Read the current GNOME favorites for Cline Desktop
ansible.builtin.command:
argv: [gsettings, get, org.gnome.shell, favorite-apps]
register: cline_gnome_favorites_current
changed_when: false
check_mode: false
- name: Pin the Cline Desktop launcher without reordering other favorites
ansible.builtin.command:
argv:
- gsettings
- set
- org.gnome.shell
- favorite-apps
- "{{ cline_gnome_favorites_desired | to_json }}"
vars:
cline_gnome_favorites_existing: "{{ cline_gnome_favorites_current.stdout | regex_replace('^@as ', '') | from_yaml }}"
cline_gnome_favorites_desired: >-
{%- set ns = namespace(apps=[]) -%}
{%- for app in cline_gnome_favorites_existing -%}
{%- set launcher = cline_desktop_launcher
if app in ['ai.opencode.desktop.desktop', 'opencode-desktop.desktop'] else app -%}
{%- if launcher != cline_desktop_launcher or launcher not in ns.apps -%}
{%- set ns.apps = ns.apps + [launcher] -%}
{%- endif -%}
{%- endfor -%}
{{ ns.apps if cline_desktop_launcher in ns.apps else ns.apps + [cline_desktop_launcher] }}
when: cline_gnome_favorites_desired != cline_gnome_favorites_existing
changed_when: true

View File

@@ -288,3 +288,8 @@
- name: Configure native VS Code
tags: [vscode]
ansible.builtin.import_tasks: vscode.yml
- name: Pin Cline Desktop in GNOME
tags: [cline_desktop]
ansible.builtin.import_tasks: cline_desktop.yml
when: cline_desktop_enabled | default(false) | bool

View File

@@ -0,0 +1,35 @@
ARG MAVEN_VERSION=3.9.16
FROM docker.io/library/maven:${MAVEN_VERSION}-eclipse-temurin-11 AS maven
FROM docker.io/library/node:22.23.4-bookworm-slim AS node
# Java 21 runs the language servers only. The final image keeps Java 11 on PATH.
FROM mcr.microsoft.com/devcontainers/java:21-bookworm AS ide
FROM mcr.microsoft.com/devcontainers/java:11-bookworm
USER root
COPY --from=ide /usr/lib/jvm/msopenjdk-current/ /opt/jdk-21/
COPY --from=maven /usr/share/maven/ /usr/share/maven/
COPY --from=node /usr/local/bin/node /usr/local/bin/node
COPY --from=node /usr/local/lib/node_modules/npm/ /usr/local/lib/node_modules/npm/
RUN ln -s /usr/share/maven/bin/mvn /usr/local/bin/mvn \
&& ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& java -version \
&& /opt/jdk-21/bin/java -version \
&& mvn -v \
&& npm install --global --no-audit --no-fund @anthropic-ai/claude-code@2.1.312 cline@3.0.74 \
&& npm cache clean --force
RUN apt-get update \
&& apt-get install -y --no-install-recommends bash-completion ca-certificates curl fzf git git-lfs gnupg openssh-client zoxide \
&& arch="$(dpkg --print-architecture)" \
&& case "$arch" in \
amd64) sha256=ea4f0222950ee750a3d38dd80d03bce4cee07a3f63928fc47548383bcaf23093 ;; \
arm64) sha256=0edc36cf514f1bd84becac3e94ee8ae9f8818c6a1f99f7b2ee67b362afa253d3 ;; \
*) echo "Unsupported architecture for delta: $arch" >&2; exit 1 ;; \
esac \
&& curl -fsSL --retry 3 "https://github.com/dandavison/delta/releases/download/0.19.2/git-delta_0.19.2_${arch}.deb" -o /tmp/git-delta.deb \
&& echo "$sha256 /tmp/git-delta.deb" | sha256sum -c - \
&& apt-get install -y --no-install-recommends /tmp/git-delta.deb \
&& rm -rf /var/lib/apt/lists/* /tmp/git-delta.deb
COPY --chown=vscode:vscode bashrc /home/vscode/.bashrc
USER vscode
# Keep this file writable so VS Code can register its Git credential helper.
RUN git config --file /home/vscode/.gitconfig include.path /run/ecaas-git/gitconfig

View File

@@ -0,0 +1,109 @@
---
- name: Refuse to deploy the ecaas workspace outside WSL
ansible.builtin.assert:
that:
- "'wsl2' in (ansible_facts.kernel | default('') | lower)"
- ansible_facts.distribution | default('') == 'Fedora'
fail_msg: Run this deployment from the Fedora WSL 2 distribution on deadalus.
- name: Prepare the ecaas workspace and private configuration
vars:
ecaas_agent_state: "{{ user_home }}/.local/state/ecaas-devcontainer"
ecaas_git_available_cas: >-
{{ ecaas_git_ca_probe.results | selectattr('stat.isreg', 'defined') |
selectattr('stat.isreg') | map(attribute='item') | list }}
ecaas_agent_config:
- src: .claude/settings.json
dest: claude/settings.json
- src: .claude/CLAUDE.md
dest: claude/CLAUDE.md
- src: .claude/rules
dest: claude/rules
- src: .claude/skills
dest: claude/skills
- src: .config/ai/bootstrap.md
dest: ai/bootstrap.md
- src: .cline/data/globalState.json
dest: cline/data/globalState.json
- src: .cline/data/settings/global-settings.json
dest: cline/data/settings/global-settings.json
- src: .cline/rules
dest: cline/rules
- src: .cline/skills
dest: cline/skills
block:
- name: Prepare the ecaas Git configuration
ansible.builtin.import_tasks: ecaas_git.yml
- name: Ensure the ecaas dev container directory exists
ansible.builtin.file:
path: "{{ workstation_ecaas_workspace }}/.devcontainer"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
- name: Ensure private ecaas agent state directories exist
ansible.builtin.file:
path: "{{ ecaas_agent_state }}{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0700"
loop:
- ""
- /ai
- /claude
- /cline
- /cline/data
- /cline/data/settings
- name: Locate supported WSL agent configuration
ansible.builtin.stat:
path: "{{ user_home }}/{{ item.src }}"
follow: false
get_checksum: false
get_mime: false
loop: "{{ ecaas_agent_config }}"
register: ecaas_agent_config_sources
- name: Seed missing private agent settings without importing credential stores
ansible.builtin.copy:
src: "{{ user_home }}/{{ item.item.src }}{{ '/' if item.stat.isdir | default(false) else '' }}"
dest: "{{ ecaas_agent_state }}/{{ item.item.dest }}"
remote_src: true
mode: preserve
force: false
local_follow: false
become_user: "{{ username }}"
when:
- item.stat.isreg | default(false) or item.stat.isdir | default(false)
- not ansible_check_mode
loop: "{{ ecaas_agent_config_sources.results }}"
no_log: true
diff: false
- name: Deploy the ecaas dev container configuration
ansible.builtin.template:
src: ecaas-devcontainer.json.j2
dest: "{{ workstation_ecaas_workspace }}/.devcontainer/devcontainer.json"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0644"
backup: true
- name: Deploy the ecaas dev container build files
ansible.builtin.copy:
src: "{{ item.src }}"
dest: "{{ workstation_ecaas_workspace }}/.devcontainer/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0644"
backup: true
loop:
- src: ecaas-devcontainer.Dockerfile
dest: Dockerfile
- src: "{{ playbook_dir }}/../dotfiles/common/.bashrc"
dest: bashrc
loop_control:
label: "{{ item.dest }}"

View File

@@ -0,0 +1,65 @@
---
- name: Locate the Git CA files configured for the workstation
ansible.builtin.stat:
path: "{{ user_home }}/.local/share/certs/{{ item.certificate }}"
follow: true
get_checksum: false
get_mime: false
loop: "{{ workstation_git_https_cas }}"
loop_control:
label: "{{ item.certificate }}"
register: ecaas_git_ca_probe
- name: Require the ecaas Git CA before deploying the dev container
ansible.builtin.assert:
that:
- workstation_ecaas_git_required_ca in (ecaas_git_available_cas | map(attribute='certificate') | list)
fail_msg: "Install the existing workstation CA at {{ user_home }}/.local/share/certs/{{ workstation_ecaas_git_required_ca }} first."
- name: Verify the available Git CA files are public PEM certificates
ansible.builtin.shell: |
if grep -q -- 'PRIVATE KEY-----' "$ECAAS_GIT_CA"; then
exit 1
fi
openssl x509 -in "$ECAAS_GIT_CA" -noout
environment:
ECAAS_GIT_CA: "{{ user_home }}/.local/share/certs/{{ item.item.certificate }}"
become_user: "{{ username }}"
check_mode: false
changed_when: false
when: item.stat.isreg | default(false)
loop: "{{ ecaas_git_ca_probe.results }}"
loop_control:
label: "{{ item.item.certificate }}"
- name: Ensure the private ecaas Git configuration directory exists
ansible.builtin.file:
path: "{{ ecaas_agent_state }}/git"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0700"
- name: Render the workstation Git configuration for the ecaas container
ansible.builtin.template:
src: "{{ playbook_dir }}/templates/workstation/.gitconfig.j2"
dest: "{{ ecaas_agent_state }}/git/gitconfig"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0600"
vars:
workstation_git_in_devcontainer: true
workstation_git_container_cas: "{{ ecaas_git_available_cas }}"
no_log: true
diff: false
- name: Deploy the workstation Git ignore and delta theme files
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/workstation/{{ item }}"
dest: "{{ ecaas_agent_state }}/git/{{ item }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0644"
loop:
- .gitignore_global
- .themes.gitignore

View File

@@ -1,4 +1,9 @@
---
- name: Deploy the ecaas Java 11 dev container
ansible.builtin.import_tasks: ecaas_devcontainer.yml
when: workstation_ecaas_workspace is defined
tags: [ecaas_devcontainer]
- name: Ensure Windows Emacs authoring directories exist
tags: [dotfiles, dotfiles:workstation, emacs, wsl]
ansible.builtin.file:

View File

@@ -0,0 +1,47 @@
{
"name": "ecaas — Java 11",
"build": {
"dockerfile": "Dockerfile",
"args": {
"MAVEN_VERSION": {{ workstation_mise_maven_version | to_json }}
}
},
"remoteUser": "vscode",
"updateRemoteUserUID": true,
"containerEnv": {
"CLAUDE_CONFIG_DIR": "/home/vscode/.claude"
},
"mounts": [
{{ ('type=bind,source=' ~ ecaas_agent_state ~ '/git,target=/run/ecaas-git,readonly') | to_json }},
{% for ca in ecaas_git_available_cas %}
{{ ('type=bind,source=' ~ user_home ~ '/.local/share/certs/' ~ ca.certificate ~ ',target=/run/ecaas-git-ca/' ~ ca.certificate ~ ',readonly') | to_json }},
{% endfor %}
{{ ('type=bind,source=' ~ ecaas_agent_state ~ '/ai,target=/home/vscode/.config/ai,readonly') | to_json }},
{{ ('type=bind,source=' ~ ecaas_agent_state ~ '/claude,target=/home/vscode/.claude') | to_json }},
{{ ('type=bind,source=' ~ ecaas_agent_state ~ '/cline,target=/home/vscode/.cline') | to_json }}
],
"forwardPorts": [8080],
"customizations": {
"vscode": {
"extensions": [
"vscjava.vscode-java-pack",
"vmware.vscode-boot-dev-pack",
"redhat.vscode-xml",
"redhat.vscode-yaml",
"anthropic.claude-code",
"saoudrizwan.claude-dev"
],
"settings": {
"java.jdt.ls.java.home": "/opt/jdk-21",
"spring-boot.ls.java.home": "/opt/jdk-21",
"java.configuration.runtimes": [
{
"name": "JavaSE-11",
"path": "/usr/lib/jvm/msopenjdk-current",
"default": true
}
]
}
}
}
}