mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-11 22:34:41 +02:00
fix(ansible/nfs_server): supprimer le montage RAID — /srv/data est NVMe bind-mount
La tâche "Mount RAID5 array (fstab + immediate)" écrasait l'entrée fstab bind-mount (/home/data → /srv/data) et remontait le RAID à chaque apply. - Suppression de ansible.posix.mount state=mounted pour le RAID - La tâche mdadm.conf devient conditionnelle (when: stdout non vide) et failed_when: false pour ne pas bloquer si le RAID n'est pas assemblé - Ajout d'un sanity-check : vérifie que /srv/data est un répertoire - Commentaires explicatifs dans tasks/ et defaults/ pour prévenir toute régression future Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
bc137d13b4
commit
77c4fe99c2
2 changed files with 20 additions and 15 deletions
|
|
@ -1,4 +1,8 @@
|
||||||
---
|
---
|
||||||
|
# RAID5 — RETIRÉ DE L'USAGE ACTIF le 2026-05-29
|
||||||
|
# /srv/data est maintenant un bind-mount NVMe (voir fstab).
|
||||||
|
# Ces variables sont conservées pour référence (mdadm.conf, incidents),
|
||||||
|
# mais ne doivent PAS être utilisées pour monter un filesystem.
|
||||||
raid_device: /dev/md127
|
raid_device: /dev/md127
|
||||||
raid_uuid: "3add8360-fa01-47eb-8aa1-0e84bacbbc15"
|
raid_uuid: "3add8360-fa01-47eb-8aa1-0e84bacbbc15"
|
||||||
raid_fstype: ext4
|
raid_fstype: ext4
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
---
|
---
|
||||||
|
# NOTE ARCHITECTURE (2026-05-29) :
|
||||||
|
# /srv/data est maintenant un bind-mount de /home/data (LV NVMe almalinux-home).
|
||||||
|
# Le RAID5 md0 n'est PLUS monté sur /srv/data — ne jamais remettre une entrée
|
||||||
|
# UUID=3add8360 dans fstab ni utiliser ansible.posix.mount state=mounted ici.
|
||||||
|
# fstab actuel : /home/data /srv/data none bind 0 0
|
||||||
|
|
||||||
- name: Install nfs-utils and mdadm
|
- name: Install nfs-utils and mdadm
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
name:
|
name:
|
||||||
|
|
@ -6,39 +12,34 @@
|
||||||
- mdadm
|
- mdadm
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
# --- RAID persistence ---
|
# --- RAID persistence (surveillance seulement — array non monté) ---
|
||||||
|
|
||||||
- name: Persist mdadm array configuration
|
- name: Capture mdadm array state
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: mdadm --detail --scan
|
cmd: mdadm --detail --scan
|
||||||
register: mdadm_scan
|
register: mdadm_scan
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
|
||||||
- name: Write /etc/mdadm.conf
|
- name: Write /etc/mdadm.conf (si array détecté)
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
content: "{{ mdadm_scan.stdout }}\n"
|
content: "{{ mdadm_scan.stdout }}\n"
|
||||||
dest: /etc/mdadm.conf
|
dest: /etc/mdadm.conf
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
when: mdadm_scan.stdout | length > 0
|
||||||
notify: Rebuild initramfs
|
notify: Rebuild initramfs
|
||||||
|
|
||||||
# --- RAID mount ---
|
# --- /srv/data géré par fstab (bind-mount NVMe) ---
|
||||||
|
# La tâche "Mount RAID5 array" a été supprimée le 2026-05-29.
|
||||||
|
# /srv/data est monté via fstab au boot. On vérifie juste que le point de
|
||||||
|
# montage existe — Ansible ne touche pas au fstab ni au montage.
|
||||||
|
|
||||||
- name: Create RAID mount point
|
- name: Ensure /srv/data is a directory (sanity check)
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ raid_mount }}"
|
path: "{{ raid_mount }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Mount RAID5 array (fstab + immediate)
|
|
||||||
ansible.posix.mount:
|
|
||||||
src: "UUID={{ raid_uuid }}"
|
|
||||||
path: "{{ raid_mount }}"
|
|
||||||
fstype: "{{ raid_fstype }}"
|
|
||||||
opts: defaults,noatime,nodiratime
|
|
||||||
state: mounted
|
|
||||||
dump: 0
|
|
||||||
passno: 2
|
|
||||||
|
|
||||||
# --- Répertoires NFS ---
|
# --- Répertoires NFS ---
|
||||||
|
|
||||||
- name: Create NFS export directories
|
- name: Create NFS export directories
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue