Initial snapshot before transformerlab recovery
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# Default variables for common role
|
||||
|
||||
common_packages_debian:
|
||||
- python3
|
||||
- python3-pip
|
||||
- git
|
||||
- curl
|
||||
- wget
|
||||
- build-essential
|
||||
- cmake
|
||||
- ninja-build
|
||||
- libssl-dev
|
||||
- pkg-config
|
||||
|
||||
common_packages_macos:
|
||||
- python3
|
||||
- git
|
||||
- curl
|
||||
- cmake
|
||||
- ninja
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
# Add local bin to PATH if not already added
|
||||
case ":${PATH}:" in
|
||||
*:"$HOME/.local/bin":*)
|
||||
;;
|
||||
*)
|
||||
export PATH="$HOME/.local/bin:$PATH"
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
# Handlers for common role
|
||||
|
||||
- name: Update PATH in shell config
|
||||
ansible.builtin.debug:
|
||||
msg: "PATH will be updated in next shell session"
|
||||
|
||||
- name: Shell updated
|
||||
ansible.builtin.debug:
|
||||
msg: "Shell configuration updated. Please restart your shell for changes to take effect."
|
||||
@@ -0,0 +1,92 @@
|
||||
---
|
||||
# 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: Ensure Homebrew is installed (macOS)
|
||||
ansible.builtin.homebrew:
|
||||
name:
|
||||
- python3
|
||||
- git
|
||||
- curl
|
||||
- cmake
|
||||
- ninja
|
||||
state: present
|
||||
when: ansible_os_family == "Darwin"
|
||||
|
||||
- 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'
|
||||
Reference in New Issue
Block a user