Le plancher pose <IP edge> <FQDN exposé> sur chaque nœud, dérivé de expose + domaines.edge (même source que nginx/PowerDNS). DNS-indépendant, aucun risque. Chargement du plan best-effort (stat delegate_to localhost + become false). Prouvé : /etc/hosts d'obs-01 régénéré avec keycloak/grafana → edge (ligne manuelle éliminée), SSO Grafana fonctionne via le plancher (login: testmail). Boucle Phase 3 fermée : expose → vhost + SAN cert + A PowerDNS + alias plancher. Bugs corrigés : serveur_loki (groupe loki manquant) déjà committé ; stat sur cible→contrôle ; become inutile sur le contrôle. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22 lines
1.1 KiB
Django/Jinja
22 lines
1.1 KiB
Django/Jinja
# /etc/hosts — GÉNÉRÉ par Set-OPS (rôle hosts_statiques) depuis l'inventaire.
|
|
# Plancher de résolution interne, indépendant du serveur DNS. NE PAS éditer à la main.
|
|
127.0.0.1 localhost
|
|
::1 localhost ip6-localhost ip6-loopback
|
|
ff02::1 ip6-allnodes
|
|
ff02::2 ip6-allrouters
|
|
|
|
# --- Écosystème (dérivé du plan ; chaque hôte → son IP réelle) ---
|
|
{% set fleet = (groups.get('hotes_actifs', []) + groups.get('hotes_planifies', [])) | unique | sort %}
|
|
{% for h in fleet if hostvars[h].ansible_host is defined %}
|
|
{{ "%-15s" | format(hostvars[h].ansible_host) }} {{ h }}{{ (' ' ~ h ~ '.' ~ hosts_statiques_domaine) if hosts_statiques_domaine else '' }}
|
|
{% endfor %}
|
|
{% if hosts_statiques_publier_expositions | default(false) and hosts_statiques_expositions %}
|
|
|
|
# --- Alias d'exposition (FQDN publics → l'edge qui les sert) ---
|
|
{% for expo in hosts_statiques_expositions %}
|
|
{% set edge_hosts = groups.get(expo.edge, []) %}
|
|
{% if edge_hosts and hostvars[edge_hosts[0]].ansible_host is defined %}
|
|
{{ "%-15s" | format(hostvars[edge_hosts[0]].ansible_host) }} {{ expo.fqdn }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|