diff --git a/roles/prerequisites/README.md b/roles/prerequisites/README.md index f1120c9..5cd087a 100644 --- a/roles/prerequisites/README.md +++ b/roles/prerequisites/README.md @@ -2,18 +2,17 @@ Diese Ansible role prüft ob die Voraussetzungen für ein Freifunk Gateway erfüllt sind. -- Forward-DNS Eintrag == ausgelesener IPv4-Adresse -- Forward-DNS Eintrag == ausgelesener IPv6-Adresse +- Forward-DNS Eintrag $FQDN == ausgelesener IPv4-Adresse +- Forward-DNS Eintrag $FQDN == ausgelesener IPv6-Adresse +- CNAME Eintrag gate$magic.freifunk-mwu.de == $FQDN +- CNAME Eintrag icvpn$magic.freifunk-mwu.de == $FQDN - Linux Distribution == Debian - Debian Version == 9 ## Benötigte Variablen +Die folgenden Variablen werden über einen DNS Lookup gesetzt: - Variable `dns_host_ipv4_address` (Rollen-Variable) -``` -dns_host_ipv4_address: "{{ lookup('dig', inventory_hostname, 'qtype=A') }}" -``` - Variable `dns_host_ipv6_address` (Rollen-Variable) -``` -dns_host_ipv6_address: "{{ lookup('dig', inventory_hostname, 'qtype=AAAA') }}" -``` +- Variable `dns_gate_num_cname` (Rollen-Variable) +- Variable `dns_gate_icvpn_cname` (Rollen-Variable) diff --git a/roles/prerequisites/tasks/main.yml b/roles/prerequisites/tasks/main.yml index b5f19bc..43f2cb9 100755 --- a/roles/prerequisites/tasks/main.yml +++ b/roles/prerequisites/tasks/main.yml @@ -5,6 +5,8 @@ that: - "dns_host_ipv4_address in ansible_all_ipv4_addresses" - "dns_host_ipv6_address in ansible_all_ipv6_addresses" + - "dns_gate_num_cname == inventory_hostname" + - "dns_gate_icvpn_cname == inventory_hostname" - "ansible_distribution == 'Debian'" - "ansible_distribution_major_version == '9'" diff --git a/roles/prerequisites/vars/main.yml b/roles/prerequisites/vars/main.yml index f0e8dca..6cb0cdd 100644 --- a/roles/prerequisites/vars/main.yml +++ b/roles/prerequisites/vars/main.yml @@ -1,4 +1,8 @@ --- +dns_gate_num: "gate{{ magic }}.{{ http_domain_external }}" +dns_gate_icvpn: "icvpn{{ magic }}.{{ http_domain_external }}" dns_host_ipv4_address: "{{ lookup('dig', inventory_hostname, 'qtype=A') }}" dns_host_ipv6_address: "{{ lookup('dig', inventory_hostname, 'qtype=AAAA') }}" +dns_gate_num_cname: "{{ lookup('dig', dns_gate_num, 'qtype=CNAME') | regex_replace('\\.$') }}" +dns_gate_icvpn_cname: "{{ lookup('dig', dns_gate_icvpn, 'qtype=CNAME') | regex_replace('\\.$') }}"