refactor: simplificar naming de nodos con auto-deducción #80

Merged
Numerica merged 26 commits from refactor-simplify-node-naming into master 2025-12-22 20:30:40 +00:00

26 Commits

Author SHA1 Message Date
bb069debaf refactor: skip vhost generation for services without domains
Services with roles but without domains specified are infrastructure
services that deploy to destination servers (like knot/knsupdate,
vpn/rap). These don't need proxy vhosts. Services with roles AND
domains, or services without roles (proxy redirections) still get vhosts.

Adds skip_vhost flag during normalization to mark services that should
not generate vhosts, based on whether they have roles but no domains.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 17:20:45 -03:00
729f931c39 refactor: improve rap_dn calculation robustness
Separates the calculation of node_name and rap_dn into intermediate
variables to make the normalization more explicit and avoid issues
with nested defaults. This makes the code clearer and more robust
when handling elements with only service_name or only nodo defined.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 16:56:08 -03:00
45fe05844e especificar puerto e IP dinamica
TODO: otra VPN / descubrir IP con ansible
2025-12-18 16:30:00 -03:00
f6f5c90d34 fix: protect vhost.ports[0] access in stream template
Prevents error when vhost.ports is defined but empty by checking
array length before rendering the stream template that accesses ports[0].

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 16:15:26 -03:00
6d442bbaa6 fix: protect vhost.roles[0] access when array is empty
Prevents error when vhost.roles is defined but empty by checking
array length before accessing index 0 in all conditional statements.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 16:01:46 -03:00
28c80118f7 vpn_proxy: parametrizar la IP en la VPN del Proxy 2025-12-18 15:55:53 -03:00
3467f774df fix: use service_name instead of domains[0] for stream config
Fixes error when vhost.domains is empty by using vhost.service_name
for the stream configuration filename, which is always available and
more consistent with the stream template usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 14:26:36 -03:00
80ed2dea5f testnet como terminal, mientras se vuelve su propia test net 2025-12-18 14:26:13 -03:00
df8b23525e fix de orden de normalizacion, bardo del merge aun 2025-12-18 13:51:34 -03:00
5e45fed446 dns_extras ya no funciona asi 2025-12-18 13:38:08 -03:00
b201c758b7 Merge branch 'refactor-simplify-node-naming' into refactor-use-main-zone-var 2025-12-18 13:37:17 -03:00
380a588f0c refactor: remove duplicate domain normalization logic
The domain normalization logic (filtering main_zone domains, creating
default domain, and ordering) was duplicated in main.yml after already
being performed in normalize_node.yml. This removes the redundant
18-line block, keeping only the normalization in normalize_node.yml.
2025-12-18 13:05:23 -03:00
5ab33a419a Actualizo RAP y corrijo su copy 2025-12-18 13:03:33 -03:00
02bfbfc2c6 fixes: variable parametrizada, dependencia de RAP actualizada 2025-12-18 12:47:15 -03:00
fae291cdc9 corrijo estas cosas por enesima vez 2025-12-18 12:11:53 -03:00
73a562b449 refactor: replace hardcoded domain with main_zone variable
- Add main_zone_regex derived from main_zone with proper escaping
- Replace hardcoded abyaya.la references in proxy tasks
- Use main_zone and main_zone_regex for domain matching and construction
2025-12-18 12:06:38 -03:00
41b8ee5647 Merge branch 'master' into refactor-simplify-node-naming 2025-12-18 11:29:48 -03:00
552911286d fix: asegurar que dominio .abyaya.la esté siempre en domains[0]
Modifica normalize_node.yml para garantizar que el dominio .abyaya.la
siempre sea el primero en la lista de dominios, independientemente del
orden definido. Esto es crítico para certificados SSL y configuraciones
vhost que dependen de domains[0].
2025-12-02 19:15:59 -03:00
8cf385b5a5 Merge branch 'customdnsfiles' into refactor-simplify-node-naming 2025-12-02 19:02:50 -03:00
5f914e071a Merge branch 'feat/parametrizar_redes' into refactor-simplify-node-naming 2025-12-02 19:01:41 -03:00
9296b21f91 Merge branch 'issue42' into refactor-simplify-node-naming 2025-12-02 19:01:01 -03:00
68ca0b5b61 fixes revision de fauno 2025-12-02 17:17:52 -03:00
f91a3360af parmetrizar los dominios de las redes: abyaya.la (proxy) y .comun (vpn)
bifurca de #issue42 en que ya estan parametrizadas zones y asi
2025-12-01 17:01:50 -03:00
76dea140c7 Merge branch 'master' into refactor-simplify-node-naming 2025-12-01 15:26:12 -03:00
ac8dd13d64 Merge branch 'master' into refactor-simplify-node-naming 2025-11-27 10:25:14 -03:00
0ee1665acb refactor: simplificar naming de nodos con auto-deducción
Cambios principales:
- Nueva variable 'nodo': nombre base (ej: marmite)
- Renombrar variable antigua 'nodo' (FQDN) -> 'rap_dn'
- Auto-deducir 'domains' desde nodo: [{{ nodo }}.abyaya.la]
- Auto-deducir 'rap_dn' desde nodo: {{ nodo }}.comun
- Extraer lógica normalización a roles/proxy/tasks/normalize_node.yml
- Agregar defaults en roles/proxy/vars/main.yml

Sintaxis nueva (simplificada):
  - nodo: marmite
    force_https: yes
    # Auto: domains: [marmite.abyaya.la], rap_dn: marmite.comun

Sintaxis FQDN externo:
  - nodo: kipu
    domains:
      - kipu.latina.red
    # Auto: rap_dn: kipu.comun

Retrocompatibilidad:
  - service_name: antigua
    domains: [antigua.abyaya.la]
    rap_dn: antigua.comun

Beneficios:
- DRY: Una sola variable define nombre
- Menos errores de tipeo
- Configuración más limpia
- Retrocompatible con service_name
2025-11-26 21:49:41 -03:00