mirror of
https://github.com/fscotto/infra.git
synced 2026-11-26 13:49:52 +00:00
Replace OpenCode Desktop with Cline and add ecaas devcontainer setup
This commit is contained in:
@@ -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 }}"
|
||||
@@ -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
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user