feat: per-node host_vars for Artemis, Mark44, Mark5, Bones; dynamic local.yml

This commit is contained in:
Artemis
2026-05-21 13:30:22 -04:00
parent 5583c6d67c
commit b93461f932
6 changed files with 210 additions and 36 deletions

View File

@@ -5,8 +5,9 @@
tasks:
- name: Print start message
debug:
msg: "Ansible Pull baseline running on {{ ansible_hostname }} ({{ inventory_hostname }})"
msg: "Ansible Pull running on {{ ansible_hostname }} ({{ inventory_hostname }}) — role: {{ node_type | default('unspecified') }}"
# --- ALL NODES: baseline ---
- name: Ensure apt packages are updated
apt:
update_cache: yes
@@ -23,49 +24,64 @@
- tmux
- jq
- vim
- python3-pip
state: present
when: ansible_os_family == "Debian"
tags: [baseline]
# --- Artemis-specific placeholder ---
- name: Ensure Artemis monitoring packages
# --- NODE-SPECIFIC: extra packages ---
- name: Ensure node-specific extra packages installed
apt:
name: "{{ extra_packages }}"
state: present
when:
- ansible_os_family == "Debian"
- extra_packages is defined
- extra_packages | length > 0
tags: [node_specific]
# --- NODE-SPECIFIC: Ollama model management ---
- name: Ensure Ollama is installed
command: which ollama
register: ollama_check
ignore_errors: true
changed_when: false
tags: [ollama]
- name: Pull node-specific Ollama models
command: "ollama pull {{ item }}"
loop: "{{ ollama_models }}"
when:
- ollama_check.rc == 0
- ollama_models is defined
- ollama_models | length > 0
register: ollama_pull_result
tags: [ollama]
# --- NODE-SPECIFIC: Service management (placeholder) ---
- name: Ensure managed services are enabled
systemd:
name: "{{ item.name }}"
enabled: "{{ item.enabled | default(true) }}"
loop: "{{ managed_services }}"
when:
- managed_services is defined
- managed_services | length > 0
ignore_errors: true
tags: [services]
# --- Artemis-specific: monitoring dashboard ---
- name: Ensure Artemis cockpit available
apt:
name:
- nethogs
- iotop
- cockpit
- cockpit-pcp
state: present
when: inventory_hostname == "Artemis"
when:
- inventory_hostname == "artemis.ai.home"
- ansible_os_family == "Debian"
tags: [artemis]
# --- Mark44 GPU node placeholder ---
- name: Ensure GPU node tools
package:
name:
- nvidia-smi
state: present
when: inventory_hostname == "mk44"
ignore_errors: true
tags: [gpu]
# --- Mark5 laptop node placeholder ---
- name: Ensure laptop power management (example)
package:
name:
- powertop
state: present
when: inventory_hostname == "mk5"
ignore_errors: true
tags: [laptop]
# --- Bones headless placeholder ---
- name: Ensure headless essentials
apt:
name:
- cpufrequtils
state: present
when: inventory_hostname == "bones"
tags: [bones]
- name: Print completion message
debug:
msg: "Baseline complete on {{ ansible_hostname }}"
msg: "Baseline complete on {{ ansible_hostname }} — node_type={{ node_type | default('unspecified') }}, gpu={{ has_gpu | default(false) }}"