Role prerequisites: add cname asserts

This commit is contained in:
Tobias Hachmer 2017-11-11 23:24:49 +01:00
parent e020ea0854
commit 623faaa40f
3 changed files with 13 additions and 8 deletions

View file

@ -2,18 +2,17 @@
Diese Ansible role prüft ob die Voraussetzungen für ein Freifunk Gateway erfüllt sind. 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 $FQDN == ausgelesener IPv4-Adresse
- Forward-DNS Eintrag == ausgelesener IPv6-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 - Linux Distribution == Debian
- Debian Version == 9 - Debian Version == 9
## Benötigte Variablen ## Benötigte Variablen
Die folgenden Variablen werden über einen DNS Lookup gesetzt:
- Variable `dns_host_ipv4_address` (Rollen-Variable) - Variable `dns_host_ipv4_address` (Rollen-Variable)
```
dns_host_ipv4_address: "{{ lookup('dig', inventory_hostname, 'qtype=A') }}"
```
- Variable `dns_host_ipv6_address` (Rollen-Variable) - Variable `dns_host_ipv6_address` (Rollen-Variable)
``` - Variable `dns_gate_num_cname` (Rollen-Variable)
dns_host_ipv6_address: "{{ lookup('dig', inventory_hostname, 'qtype=AAAA') }}" - Variable `dns_gate_icvpn_cname` (Rollen-Variable)
```

View file

@ -5,6 +5,8 @@
that: that:
- "dns_host_ipv4_address in ansible_all_ipv4_addresses" - "dns_host_ipv4_address in ansible_all_ipv4_addresses"
- "dns_host_ipv6_address in ansible_all_ipv6_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 == 'Debian'"
- "ansible_distribution_major_version == '9'" - "ansible_distribution_major_version == '9'"

View file

@ -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_ipv4_address: "{{ lookup('dig', inventory_hostname, 'qtype=A') }}"
dns_host_ipv6_address: "{{ lookup('dig', inventory_hostname, 'qtype=AAAA') }}" 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('\\.$') }}"