bigboy-alma-deploy/ansible/site.yml

87 lines
No EOL
3.5 KiB
YAML

---
# BigBoy AlmaLinux 10 Deployment Playbook
# Execution: ansible-playbook site.yml -i inventory.ini --tags phase-2,phase-3
# Or single phase: ansible-playbook site.yml -i inventory.ini --tags phase-3
#
# NOTE on connection settings: ansible_user, ansible_ssh_private_key_file,
# etc. belong in inventory.ini, NOT here. An earlier version of this file
# set `ansible_user: root` / `ansible_become: false` directly in play
# vars — since play-level vars take precedence over inventory vars in
# Ansible's variable resolution order, that would silently override any
# fix made in inventory.ini. Root SSH doesn't work on BigBoy at all
# (rootpw --lock in the kickstart) — connection details are inventory's
# job alone.
- name: "BigBoy AlmaLinux 10 Deployment"
hosts: bigboy
become: true
gather_facts: yes
vars_files:
- group_vars/bigboy.yml
pre_tasks:
- name: "Log deployment start"
ansible.builtin.lineinfile:
path: "{{ deployment_log_dir }}/deployment.log"
create: yes
line: "[{{ ansible_date_time.iso8601 }}] Starting BigBoy deployment on {{ inventory_hostname }}"
mode: "0644"
- name: "Validate prerequisites"
ansible.builtin.assert:
that:
- ansible_os_family == "RedHat"
- ansible_distribution == "AlmaLinux"
- ansible_distribution_major_version == "10"
fail_msg: "This playbook requires AlmaLinux 10.x (detected: {{ ansible_distribution }} {{ ansible_distribution_version }})"
roles:
# Phase 2: System Configuration
- role: phase-2-system-config
tags: [phase-2, system-config, required]
# Phase 3: Filesystem Conversion (four SATA drives, xfs -> btrfs)
- role: phase-3-filesystems
tags: [phase-3, filesystems, required]
# Phase 4/5 roles not yet written — see ../tasks/TASK-phase4-5-bringup.md
# for the fully scoped task. These are commented out deliberately, not
# just stylistically: a static roles: list entry pointing at a
# nonexistent role directory fails at parse time, before tag
# filtering even applies — so this isn't optional tidiness, the play
# won't run at all with these active and unbuilt.
#
# - role: phase-4-nvidia-driver
# tags: [phase-4, gpu, nvidia, required]
#
# - role: phase-5-llama-cpp
# tags: [phase-5, llama-cpp, inference]
post_tasks:
- name: "Log deployment completion"
ansible.builtin.lineinfile:
path: "{{ deployment_log_dir }}/deployment.log"
line: "[{{ ansible_date_time.iso8601 }}] Deployment complete on {{ inventory_hostname }}"
- name: "Display summary"
ansible.builtin.debug:
msg: |
========================================
BigBoy Deployment Summary
========================================
Host: {{ inventory_hostname }}
OS: {{ ansible_distribution }} {{ ansible_distribution_version }}
Kernel: {{ ansible_kernel_release }}
Deployment Log: {{ deployment_log_dir }}/deployment.log
Next Steps:
1. Verify filesystems: df -h /srv/*
2. Confirm root is still xfs: findmnt -n -o FSTYPE /
3. (Once Phase 4/5 run) Test GPU: nvidia-smi
4. (Once Phase 4/5 run) Test llama-server:
systemctl status llama-server
5. Review logs: tail -f {{ deployment_log_dir }}/*.log
For detailed logs from each phase, see:
{{ deployment_log_dir }}/phase-*.log
========================================