Focus local lab deployment on Linux and WSL
This commit is contained in:
@@ -1,56 +1,14 @@
|
||||
- name: Classify supported host profile
|
||||
set_fact:
|
||||
courseware_is_macos: "{{ ansible_system == 'Darwin' }}"
|
||||
courseware_is_linux: "{{ ansible_system == 'Linux' }}"
|
||||
courseware_is_wsl: "{{ 'microsoft' in ansible_kernel | lower or 'wsl' in ansible_kernel | lower }}"
|
||||
courseware_is_native_linux: "{{ ansible_system == 'Linux' and not ('microsoft' in ansible_kernel | lower or 'wsl' in ansible_kernel | lower) }}"
|
||||
courseware_host_profile: "{{ 'macos' if ansible_system == 'Darwin' else ('wsl' if ('microsoft' in ansible_kernel | lower or 'wsl' in ansible_kernel | lower) else ('native-debian-ubuntu' if ansible_system == 'Linux' and ansible_os_family == 'Debian' else 'unsupported')) }}"
|
||||
courseware_host_profile: "{{ 'wsl' if ansible_system == 'Linux' and ('microsoft' in ansible_kernel | lower or 'wsl' in ansible_kernel | lower) else ('native-debian-ubuntu' if ansible_system == 'Linux' and ansible_os_family == 'Debian' else 'unsupported') }}"
|
||||
|
||||
- name: Fail on unsupported operating systems
|
||||
fail:
|
||||
msg: "Supported platforms are Apple Silicon macOS and Debian-family Linux/WSL."
|
||||
when: ansible_system not in ["Darwin", "Linux"]
|
||||
|
||||
- name: Fail on unsupported macOS architecture
|
||||
fail:
|
||||
msg: "This installer supports Apple Silicon Macs only."
|
||||
when:
|
||||
- ansible_system == "Darwin"
|
||||
- ansible_architecture not in ["arm64", "aarch64"]
|
||||
|
||||
- name: Fail on undersized macOS systems
|
||||
fail:
|
||||
msg: "This courseware assumes a modern Apple Silicon Mac with at least 16 GB of unified memory."
|
||||
when:
|
||||
- ansible_system == "Darwin"
|
||||
- (ansible_memtotal_mb | int) < 16000
|
||||
|
||||
- name: Check for Xcode command line tools
|
||||
command: xcode-select -p
|
||||
register: courseware_xcode_select
|
||||
changed_when: false
|
||||
when: ansible_system == "Darwin"
|
||||
|
||||
- name: Check for Homebrew
|
||||
command: which brew
|
||||
register: courseware_brew_check
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when: ansible_system == "Darwin"
|
||||
|
||||
- name: Fail when Xcode command line tools are missing
|
||||
fail:
|
||||
msg: "Install Xcode Command Line Tools first with 'xcode-select --install'."
|
||||
when:
|
||||
- ansible_system == "Darwin"
|
||||
- courseware_xcode_select.rc != 0
|
||||
|
||||
- name: Fail when Homebrew is missing
|
||||
fail:
|
||||
msg: "Install Homebrew first from https://brew.sh/."
|
||||
when:
|
||||
- ansible_system == "Darwin"
|
||||
- courseware_brew_check.rc != 0
|
||||
msg: "Supported platforms are Debian-family Linux and WSL."
|
||||
when: courseware_host_profile == "unsupported"
|
||||
|
||||
- name: Fail on unsupported Linux family
|
||||
fail:
|
||||
@@ -330,6 +288,5 @@
|
||||
|
||||
- name: Set runtime binary defaults
|
||||
set_fact:
|
||||
courseware_python_bin: >-
|
||||
{{ '/opt/homebrew/opt/python@3.11/bin/python3.11' if ansible_system == 'Darwin' else '/usr/bin/python3' }}
|
||||
courseware_python_bin: "/usr/bin/python3"
|
||||
courseware_ollama_bin: "ollama"
|
||||
|
||||
Reference in New Issue
Block a user