fiches : pas 4, client_backup_cible pose par la fiche du site
site_intrants.POSES_PAR_LA_FICHE : l'instancier pose ces intrants sur chaque hote depuis la fiche (presentee, sinon deposee ; jamais sans fiche), une variable d'hote l'emportant sur les group_vars. Une copie restante chez le locataire est refusee (site_intrants --verifier, P84). L'atlas lit la fiche d'abord. Premiere clef : client_backup_cible. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d153d50353
commit
eab65c1ab5
6 changed files with 88 additions and 4 deletions
|
|
@ -703,6 +703,11 @@ def verifier_fiche(site: "Site", locataire: "Locataire", fiche: dict | None = No
|
|||
vu = si._declare_par_le_locataire()
|
||||
valeurs = dict(f["offre"], ip_publique=f["attribue"]["ip_publique"])
|
||||
for clef, copie in vu.items():
|
||||
# Un intrant que la fiche POSE (pas 4) n'a plus de copie a avoir : il est refuse, pas compare.
|
||||
if clef in si.POSES_PAR_LA_FICHE:
|
||||
fichier, variable = si.OU_LE_LOCATAIRE_LE_DIT[clef]
|
||||
ecarts.append(f"{variable} ({fichier}) : copie a retirer — la fiche du site la pose sur chaque hote")
|
||||
continue
|
||||
attendu = valeurs.get(clef)
|
||||
if not attendu or "{{" in str(copie):
|
||||
continue
|
||||
|
|
@ -747,6 +752,15 @@ def verifier_fiche(site: "Site", locataire: "Locataire", fiche: dict | None = No
|
|||
ecarts.append(f"{h} : hosts_statiques_site = {v.get('hosts_statiques_site')}, "
|
||||
f"la fiche dit {hotes_site}")
|
||||
break
|
||||
# Les intrants que la fiche pose sur chaque hote (pas 4, `site_intrants.POSES_PAR_LA_FICHE`).
|
||||
for clef in si.POSES_PAR_LA_FICHE:
|
||||
attendu_k = f["offre"].get(clef)
|
||||
if attendu_k in (None, "", [], {}):
|
||||
continue
|
||||
faux = [h for h, v in sorted(hv.items()) if v.get(clef) != attendu_k]
|
||||
if faux:
|
||||
ecarts.append(f"{faux[0]} : {clef} = {hv[faux[0]].get(clef)!r}, la fiche dit {attendu_k!r}"
|
||||
+ (f" (et {len(faux) - 1} autre(s) hote(s))" if len(faux) > 1 else ""))
|
||||
sdn = gen["routage_tenants"] == "sdn"
|
||||
for h, v in sorted(hv.items()):
|
||||
if sdn and (not v.get("proxmox_pont") or v.get("proxmox_etiquette_vlan")):
|
||||
|
|
|
|||
Loading…
Reference in a new issue