Optimized tests für run once

This commit is contained in:
2025-08-12 02:38:37 +02:00
parent 82aaf7ad74
commit 1595a7c4a6
148 changed files with 1803 additions and 1147 deletions

View File

@@ -1,4 +1,3 @@
---
galaxy_info:
author: "Kevin Veen-Birkenbach"
description: "An Ansible role to redirect www subdomains to non-www domains in Nginx"
@@ -10,17 +9,15 @@ galaxy_info:
https://www.veen.world
min_ansible_version: "2.9"
platforms:
- name: Archlinux
versions:
- rolling
- name: Archlinux
versions:
- rolling
galaxy_tags:
- nginx
- redirect
- www
- wildcard
- seo
- nginx
- redirect
- www
- wildcard
- seo
repository: "https://github.com/kevinveenbirkenbach/infinito-nexus"
issue_tracker_url: "https://github.com/kevinveenbirkenbach/infinito-nexus/issues"
documentation: "https://docs.infinito.nexus"
dependencies:
- srv-web-7-4-core

View File

@@ -1,4 +1,11 @@
---
- name: Load former meta dependencies once
block:
- name: Include moved dependency 'srv-web-7-4-core'
include_role:
name: srv-web-7-4-core
- set_fact:
run_once_web_opt_rdr_www: true
when: run_once_web_opt_rdr_www is not defined
- name: Filter www-prefixed domains from current_play_domains_all
set_fact:
www_domains: "{{ current_play_domains_all | select('match', '^www\\.') | list }}"
@@ -7,20 +14,14 @@
include_role:
name: web-opt-rdr-domains
vars:
domain_mappings: "{{ www_domains
| map('regex_replace',
'^www\\.(.+)$',
'{ source: \"www.\\1\", target: \"\\1\" }')
| map('from_yaml')
| list
}}"
domain_mappings: "{{ www_domains | map('regex_replace', '^www\\.(.+)$', '{ source: \"www.\\1\", target: \"\\1\" }') | map('from_yaml') | list }}"
- name: Include DNS role to set redirects
include_role:
name: srv-web-7-7-dns-records
vars:
cloudflare_api_token: "{{ certbot_dns_api_token }}"
cloudflare_domains: "{{ www_domains }}"
cloudflare_target_ip: "{{ networks.internet.ip4 }}"
cloudflare_proxied: false
when: dns_provider == 'cloudflare'
cloudflare_api_token: "{{ certbot_dns_api_token }}"
cloudflare_domains: "{{ www_domains }}"
cloudflare_target_ip: "{{ networks.internet.ip4 }}"
cloudflare_proxied: false
when: dns_provider == 'cloudflare'