resolution_interne : entre machines du site, chaque nom mene a son service
L edge expose les interfaces web aux personnes ; les VM du site vont directement au service. Declare par domaine (service | edge, defaut edge) ; plancher, zone et certificat du service suivent. Pose au site : 35 planchers sur 35 conformes ; locataires inchanges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
efb1b3d334
commit
1bd211d62b
9 changed files with 112 additions and 13 deletions
|
|
@ -43,6 +43,12 @@ client_pki_cle: "{{ client_pki_steppath }}/certs/{{ client_pki_nom_cert }}.key"
|
|||
# ON N'AJOUTE QUE CE QUE CET HOTE SERT REELLEMENT : `edge` nomme le groupe qui rend le
|
||||
# service, et l'hote doit en faire partie. Un certificat qui revendiquerait le nom d'un
|
||||
# service rendu ailleurs serait une usurpation, pas une commodite.
|
||||
#
|
||||
# ET LE SERVICE LUI-MEME, QUAND LES MACHINES Y VONT DIRECTEMENT (2026-09-29). Avec
|
||||
# `resolution_interne: service` (le site), le plancher et la zone menent le nom au service,
|
||||
# pas a l'edge : c'est lui qui doit le porter. Sans cela, une reconstruction de
|
||||
# `site-forge-01` aurait rendu un certificat sans `forge.genese.internal`, et le runner du
|
||||
# site — qui y va directement — aurait bute sur le nom.
|
||||
client_pki_expositions: "{{ hosts_statiques_expositions | default([]) }}"
|
||||
client_pki_sans: >-
|
||||
{{ ([client_pki_nom_cert,
|
||||
|
|
@ -52,6 +58,12 @@ client_pki_sans: >-
|
|||
| selectattr('edge', 'defined')
|
||||
| selectattr('fqdn', 'defined')
|
||||
| selectattr('edge', 'in', group_names)
|
||||
| map(attribute='fqdn') | list)
|
||||
+ (client_pki_expositions
|
||||
| selectattr('fqdn', 'defined')
|
||||
| selectattr('resout_vers', 'defined')
|
||||
| selectattr('resout_vers', 'equalto', 'service')
|
||||
| selectattr('hote', 'equalto', inventory_hostname)
|
||||
| map(attribute='fqdn') | list))
|
||||
| select | unique | list }}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,12 @@ ff02::2 ip6-allrouters
|
|||
{% if hosts_statiques_publier_expositions | default(false) and hosts_statiques_expositions %}
|
||||
|
||||
# --- Alias d'exposition (FQDN publics → l'edge qui les sert) ---
|
||||
{# `resout_vers: service` — entre machines on va au service, l'edge sert aux personnes
|
||||
(voir `expositions_des_applications`). La zone PowerDNS suit la MEME regle. #}
|
||||
{% 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 }}
|
||||
{% set cibles = [expo.hote] if expo.resout_vers | default('edge') == 'service' else groups.get(expo.edge, []) %}
|
||||
{% if cibles and cibles[0] in hostvars and hostvars[cibles[0]].ansible_host is defined %}
|
||||
{{ "%-15s" | format(hostvars[cibles[0]].ansible_host) }} {{ expo.fqdn }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ $TTL {{ serveur_powerdns_ttl }}
|
|||
|
||||
{% if serveur_powerdns_publier_expositions | default(false) %}
|
||||
{% for expo in serveur_powerdns_expositions | default([]) if expo.domaine == serveur_powerdns_zone %}
|
||||
{% set edge_hosts = groups.get(expo.edge, []) %}
|
||||
{% if edge_hosts and hostvars[edge_hosts[0]].ansible_host is defined %}
|
||||
{{ expo.fqdn[:-(serveur_powerdns_zone | length + 1)] }} IN A {{ hostvars[edge_hosts[0]].ansible_host }}
|
||||
{% set cibles = [expo.hote] if expo.resout_vers | default('edge') == 'service' else groups.get(expo.edge, []) %}
|
||||
{% if cibles and cibles[0] in hostvars and hostvars[cibles[0]].ansible_host is defined %}
|
||||
{{ expo.fqdn[:-(serveur_powerdns_zone | length + 1)] }} IN A {{ hostvars[cibles[0]].ansible_host }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
@ -73,9 +73,9 @@ $TTL {{ serveur_powerdns_ttl }}
|
|||
{% endfor %}
|
||||
{% if serveur_powerdns_publier_expositions | default(false) %}
|
||||
{% for expo in serveur_powerdns_expositions | default([]) if expo.domaine == serveur_powerdns_zone %}
|
||||
{% set edge_hosts = groups.get(expo.edge, []) %}
|
||||
{% if edge_hosts and hostvars[edge_hosts[0]].ansible_host is defined %}
|
||||
{% set _ = _plancher.append(expo.fqdn ~ ' ' ~ hostvars[edge_hosts[0]].ansible_host) %}
|
||||
{% set cibles = [expo.hote] if expo.resout_vers | default('edge') == 'service' else groups.get(expo.edge, []) %}
|
||||
{% if cibles and cibles[0] in hostvars and hostvars[cibles[0]].ansible_host is defined %}
|
||||
{% set _ = _plancher.append(expo.fqdn ~ ' ' ~ hostvars[cibles[0]].ansible_host) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue