Files
infra/ansible/roles/profile_workstation_dev_common/tasks/main.yml
2026-08-31 10:02:32 +02:00

86 lines
2.5 KiB
YAML

---
- name: Ensure workstation user directories exist
tags: [dotfiles, dotfiles:workstation]
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ workstation_user_directories | default([]) }}"
loop_control:
label: "{{ item.path }}"
- name: Copy workstation dotfiles
tags: [dotfiles, dotfiles:workstation]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/workstation/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ workstation_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
- name: Render workstation templates
tags: [dotfiles, dotfiles:workstation]
ansible.builtin.template:
src: "{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ workstation_templates | default([]) }}"
loop_control:
label: "{{ item.dest }}"
- name: Install shared AI coding agents on workstation
tags: [packages, npm, ai_agents]
community.general.npm:
name: "{{ item.value.npm_package }}"
global: true
state: latest
become: true
loop: "{{ ai_agents | dict2items | selectattr('value.npm_package', 'defined') | list }}"
when:
- item.value.install_enabled | bool
loop_control:
label: "{{ item.key }}"
- name: Uninstall shared AI coding agents on workstation
tags: [packages, npm, ai_agents]
community.general.npm:
name: "{{ item.value.npm_package }}"
global: true
state: absent
become: true
loop: "{{ ai_agents | dict2items | selectattr('value.npm_package', 'defined') | list }}"
when:
- item.value.uninstall_enabled | bool
loop_control:
label: "{{ item.key }}"
- name: Install IBM Bob coding agent
tags: [packages, ai_agents]
ansible.builtin.shell: >
curl -fsSL {{ workstation_ibm_bob_install_url }} | bash
args:
executable: /bin/bash
creates: /usr/local/bin/bob
become: true
when:
- workstation_manage_ibm_bob | default(false)
- ai_agents.ibm_bob.install_enabled | bool
- workstation_ibm_bob_install_url | length > 0
- name: Uninstall IBM Bob coding agent binary
tags: [packages, ai_agents]
ansible.builtin.file:
path: /usr/local/bin/bob
state: absent
become: true
when:
- workstation_manage_ibm_bob | default(false)
- ai_agents.ibm_bob.uninstall_enabled | bool