prole/infrastructure/playbooks/site.yml

127 lines
2.8 KiB
YAML

---
# Runbook tiers (systemd-like startup ordering):
# 1) boot / kernel
# 2) storage: iscsi auth, iscsi login
# 3) filesystem mount
# 4) OS configuration (e.g., samba)
# 5) OS package installation (k3s)
# 6) OS package configuration (helm/kubectl apply)
#
# This playbook is intentionally ordered so each tier fully completes before
# moving on to the next tier.
- name: Tier 1 - Boot / kernel (cgroups)
hosts: k3s_hosts
gather_facts: false
become: true
serial: 1
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
roles:
- cgroups
- name: Tier 2 - Storage (iSCSI auth/login)
hosts: iscsi
gather_facts: false
become: true
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
tasks:
- name: iSCSI auth/login
ansible.builtin.import_role:
name: iscsi
tasks_from: login
- name: Tier 3 - Filesystem mounts (iSCSI)
hosts: iscsi
gather_facts: false
become: true
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
tasks:
- name: iSCSI mounts
ansible.builtin.import_role:
name: iscsi
tasks_from: mount
- name: Tier 4 - OS configuration (Pi-hole DNS and resilience)
hosts: pihole
gather_facts: false
become: true
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
roles:
- pihole_dns
- name: Tier 4 - OS configuration (Samba AD DNS reverse zones and PTRs)
hosts: ad_dc
gather_facts: false
become: true
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
roles:
- samba_ad_dc
- samba_dns
- samba_reverse_dns
- name: Tier 4 - OS configuration (base linux)
hosts: linux_hosts
gather_facts: false
become: true
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
roles:
- local_user
- rsyslog
- prole
- name: Tier 5 - OS package installation (k3s)
hosts: k3s_hosts
gather_facts: false
become: true
serial: 1
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
tasks:
- name: Install and start k3s
ansible.builtin.import_role:
name: k3s
tasks_from: install
- name: Tier 6 - OS package configuration (helm/kubectl apply)
hosts: k3s_hosts
gather_facts: false
become: true
serial: 1
pre_tasks:
- name: Gather minimal facts
ansible.builtin.setup:
gather_subset:
- min
tasks:
- name: Configure k3s add-ons
ansible.builtin.import_role:
name: k3s
tasks_from: configure