|
|
|
@@ -1,11 +1,3 @@
|
|
|
|
|
- name: Fail when student password hash is not configured
|
|
|
|
|
fail:
|
|
|
|
|
msg: >-
|
|
|
|
|
Set COURSEWARE_STUDENT_PASSWORD_HASH in the environment before running ./labctl up.
|
|
|
|
|
Example:
|
|
|
|
|
export COURSEWARE_STUDENT_PASSWORD_HASH="$(openssl passwd -6 'student-password')"
|
|
|
|
|
when: courseware_student_password_hash | trim | length == 0
|
|
|
|
|
|
|
|
|
|
- name: Install terminal prerequisites
|
|
|
|
|
become: true
|
|
|
|
|
apt:
|
|
|
|
@@ -79,84 +71,6 @@
|
|
|
|
|
- ansible_service_mgr != "systemd"
|
|
|
|
|
- courseware_terminal_sshd_pid.rc != 0
|
|
|
|
|
|
|
|
|
|
- name: Ensure managed terminal user exists
|
|
|
|
|
become: true
|
|
|
|
|
user:
|
|
|
|
|
name: "{{ courseware_student_username }}"
|
|
|
|
|
password: "{{ courseware_student_password_hash }}"
|
|
|
|
|
shell: /bin/bash
|
|
|
|
|
create_home: true
|
|
|
|
|
state: present
|
|
|
|
|
|
|
|
|
|
- name: Ensure lab 3 workspace root exists
|
|
|
|
|
become: true
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ courseware_lab3_dir }}"
|
|
|
|
|
state: directory
|
|
|
|
|
owner: "{{ courseware_student_username }}"
|
|
|
|
|
group: "{{ courseware_student_username }}"
|
|
|
|
|
mode: "0755"
|
|
|
|
|
|
|
|
|
|
- name: Ensure lab 3 WhiteRabbitNeo workspace exists
|
|
|
|
|
become: true
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ courseware_lab3_dir }}/WhiteRabbitNeo"
|
|
|
|
|
state: directory
|
|
|
|
|
owner: "{{ courseware_student_username }}"
|
|
|
|
|
group: "{{ courseware_student_username }}"
|
|
|
|
|
mode: "0755"
|
|
|
|
|
|
|
|
|
|
- name: Write lab 3 workspace README
|
|
|
|
|
become: true
|
|
|
|
|
template:
|
|
|
|
|
src: lab3-workspace-readme.txt.j2
|
|
|
|
|
dest: "{{ courseware_lab3_dir }}/README.txt"
|
|
|
|
|
owner: "{{ courseware_student_username }}"
|
|
|
|
|
group: "{{ courseware_student_username }}"
|
|
|
|
|
mode: "0644"
|
|
|
|
|
|
|
|
|
|
- name: Check for repo-local WhiteRabbitNeo base repo
|
|
|
|
|
stat:
|
|
|
|
|
path: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo-V3-7B"
|
|
|
|
|
register: courseware_lab3_base_repo_stat
|
|
|
|
|
|
|
|
|
|
- name: Check for repo-local WhiteRabbitNeo GGUF directory
|
|
|
|
|
stat:
|
|
|
|
|
path: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
|
|
|
|
|
register: courseware_lab3_gguf_repo_stat
|
|
|
|
|
|
|
|
|
|
- name: Link WhiteRabbitNeo base repo into the student workspace when repo-local assets exist
|
|
|
|
|
become: true
|
|
|
|
|
file:
|
|
|
|
|
src: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo-V3-7B"
|
|
|
|
|
dest: "{{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo-V3-7B"
|
|
|
|
|
state: link
|
|
|
|
|
force: true
|
|
|
|
|
owner: "{{ courseware_student_username }}"
|
|
|
|
|
group: "{{ courseware_student_username }}"
|
|
|
|
|
when: courseware_lab3_base_repo_stat.stat.exists
|
|
|
|
|
|
|
|
|
|
- name: Link WhiteRabbitNeo GGUF directory into the student workspace when repo-local assets exist
|
|
|
|
|
become: true
|
|
|
|
|
file:
|
|
|
|
|
src: "{{ courseware_root }}/assets/lab2/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
|
|
|
|
|
dest: "{{ courseware_lab3_dir }}/WhiteRabbitNeo/WhiteRabbitNeo_WhiteRabbitNeo-V3-7B-GGUF"
|
|
|
|
|
state: link
|
|
|
|
|
force: true
|
|
|
|
|
owner: "{{ courseware_student_username }}"
|
|
|
|
|
group: "{{ courseware_student_username }}"
|
|
|
|
|
when: courseware_lab3_gguf_repo_stat.stat.exists
|
|
|
|
|
|
|
|
|
|
- name: Link WhiteRabbitNeo download helper into the student workspace
|
|
|
|
|
become: true
|
|
|
|
|
file:
|
|
|
|
|
src: "{{ courseware_lab2_dir }}/download_whiterabbitneo-gguf.sh"
|
|
|
|
|
dest: "{{ courseware_lab3_dir }}/download_whiterabbitneo-gguf.sh"
|
|
|
|
|
state: link
|
|
|
|
|
force: true
|
|
|
|
|
owner: "{{ courseware_student_username }}"
|
|
|
|
|
group: "{{ courseware_student_username }}"
|
|
|
|
|
|
|
|
|
|
- name: Create contained WeTTY directory
|
|
|
|
|
file:
|
|
|
|
|
path: "{{ courseware_wetty_dir }}"
|
|
|
|
|