Files
LLM-Labs-Local/ansible/roles/common/tasks/main.yml
T
2026-04-24 21:32:01 -06:00

82 lines
1.9 KiB
YAML

---
# Common setup tasks - runs on all platforms
- name: Ensure required system packages are installed (Debian/Ubuntu)
ansible.builtin.apt:
name:
- python3
- python3-pip
- git
- curl
- wget
- build-essential
- cmake
- ninja-build
- libssl-dev
- pkg-config
- zstd
state: present
update_cache: no
when: ansible_os_family == "Debian"
become: yes
- name: Install Python virtual environment module (user space)
ansible.builtin.pip:
name: virtualenv
state: present
executable: pip3
extra_args: "--break-system-packages"
become: no
when: ansible_os_family == "Debian"
- name: Create lab base directory structure
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: '0755'
loop:
- "{{ llmlab_base }}/lab1"
- "{{ llmlab_base }}/lab2"
- "{{ llmlab_base }}/lab3"
- "{{ llmlab_base }}/lab4"
- "{{ llmlab_base }}/lab5"
- "{{ llmlab_base }}/lab6"
- "{{ llmlab_base }}/.llmlab"
- "{{ llmlab_base }}/.llmlab/logs"
become: no
- name: Create .local/bin directory
ansible.builtin.file:
path: "{{ llmlab_base }}/.local/bin"
state: directory
mode: '0755'
become: no
- name: Copy common environment script
ansible.builtin.copy:
src: "{{ playbook_dir }}/roles/common/files/env"
dest: "{{ llmlab_base }}/.local/bin/env"
mode: '0755'
force: yes
notify: Update PATH in shell config
- name: Ensure .local/bin is in PATH
ansible.builtin.lineinfile:
path: "{{ llmlab_base }}/.bashrc"
line: 'export PATH="$HOME/.local/bin:$PATH"'
state: present
insertafter: EOF
notify: Shell updated
- name: Create logs directory
ansible.builtin.file:
path: "{{ llmlab_base }}/.llmlab/logs"
state: directory
mode: '0755'
- name: Create setup log file
ansible.builtin.file:
path: "{{ llmlab_base }}/.llmlab/logs/setup.log"
state: touch
mode: '0644'