Rework passwordstore lookup handling in roles service-fastd-mesh und service-fastd-intragate
This commit is contained in:
parent
7437095761
commit
78a141305d
7 changed files with 16 additions and 60 deletions
14
Readme.md
14
Readme.md
|
@ -57,6 +57,7 @@ Diese Liste ist quasi das Herzstück zur Konfiguration der Mesh-spezifischen Par
|
|||
|fastd.nodes.instances[x].peers|Dictionary||||
|
||||
|fastd.nodes.instances[x].peers.repo|Key|https://github.com/freifunk-mwu/peers-ffmz.git|URL||
|
||||
|fastd.nodes.instances[x].peers.version|Key|master|string||
|
||||
|fastd.nodes.instances[x].pass|Key|fastd/mzvpn|string||
|
||||
|fastd.intragate|Dictionary||||
|
||||
|fastd.intragate.instances|List|||Jeder Listeneintrag ist ein Dictionary; Instanzen für Intragate-Kommunikation|
|
||||
|fastd.intragate.instances[x].id|Key|0|integer||
|
||||
|
@ -64,6 +65,7 @@ Diese Liste ist quasi das Herzstück zur Konfiguration der Mesh-spezifischen Par
|
|||
|fastd.intragate.instances[x].peers|Dictionary||||
|
||||
|fastd.intragate.instances[x].peers.repo|Key|https://github.com/freifunk-mwu/peers-ffmz.git|URL||
|
||||
|fastd.intragate.instances[x].peers.version|Key|master|string||
|
||||
|fastd.intragate.instances[x].pass|Key|fastd/mzigvpn|string||
|
||||
|dns|Dictionary||||
|
||||
|dns.master|Key|fd37:b4dc:4b1e::a25:103|string; IP-Adresse|DNS-Master IP|
|
||||
|dns.forward_zones|List||||
|
||||
|
@ -134,11 +136,6 @@ Alle Server- bzw. Gateway-spezifischen Parameter werden als Host-Variablen abgeb
|
|||
|ffrl_exit_server.ffrl-b-fra2-fra.public_ipv4_address|Key|185.66.194.1|IP-Adresse|IP-Adresse der Tunnel-Gegenstelle|
|
||||
|ffrl_exit_server.ffrl-b-fra2-fra.tunnel_ipv4_network|Key|100.64.0.188/31|Network/Prefix|Internes IPv4-Tunnel-Subnetz|
|
||||
|ffrl_exit_server.ffrl-b-fra2-fra.tunnel_ipv6_network|Key|2a03:2260:0:64::/64|Network/Prefix|Internes IPv6-Tunnel-Subnetz|
|
||||
|fastd_secrets|Dictionary|||Ein Eintrag pro fastd-Interface mit passwordstore lookup zum pass-Pfad|
|
||||
|fastd_secrets.mzvpn|Key|"{{ lookup('passwordstore', 'fastd/mzvpn/spinat subkey=secret') }}"|||
|
||||
|fastd_secrets.wivpn|Key|"{{ lookup('passwordstore', 'fastd/wivpn/spinat subkey=secret') }}"|||
|
||||
|fastd_secrets.mzigvpn|Key|"{{ lookup('passwordstore', 'fastd/mzvpn/spinat subkey=secret') }}"|||
|
||||
|fastd_secrets.wiigvpn|Key|"{{ lookup('passwordstore', 'fastd/wivpn/spinat subkey=secret') }}"|||
|
||||
|tinc_private_key|Variable|"{{ lookup('passwordstore', 'tinc/icvpn/spinat_private returnall=true') }}"||Passwordstore lookup zum pass-Pfad|
|
||||
|
||||
## Sensible Informationen
|
||||
|
@ -194,13 +191,6 @@ ffrl_exit_server:
|
|||
tunnel_ipv4_network: # Format: IP/Maske
|
||||
tunnel_ipv6_network:
|
||||
|
||||
# Pfade zu den fastd secrets im passwordstore
|
||||
fastd_secrets:
|
||||
mzvpn: "{{ lookup('passwordstore', 'fastd/mzvpn/$Hostname subkey=secret') }}"
|
||||
wivpn: "{{ lookup('passwordstore', 'fastd/wivpn/$Hostname subkey=secret') }}"
|
||||
mzigvpn: "{{ lookup('passwordstore', 'fastd/mzvpn/$Hostname subkey=secret') }}"
|
||||
wiigvpn: "{{ lookup('passwordstore', 'fastd/wivpn/$Hostname subkey=secret') }}"
|
||||
|
||||
# Pfade zum tinc secret im passwordstore
|
||||
tinc_private_key: "{{ lookup('passwordstore', 'tinc/icvpn/$hostname_private returnall=true') }}"
|
||||
```
|
||||
|
|
|
@ -51,11 +51,13 @@ meshes:
|
|||
peers:
|
||||
repo: https://github.com/freifunk-mwu/peers-ffmz.git
|
||||
version: master
|
||||
pass: fastd/mzvpn
|
||||
- id: 1
|
||||
mtu: 1312
|
||||
peers:
|
||||
repo: https://github.com/freifunk-mwu/peers-ffmz.git
|
||||
version: master
|
||||
pass: fastd/mzvpn
|
||||
intragate:
|
||||
instances:
|
||||
- id: 0
|
||||
|
@ -63,6 +65,7 @@ meshes:
|
|||
peers:
|
||||
repo: https://github.com/freifunk-mwu/ffmz-infrastructure-peers.git
|
||||
version: master
|
||||
pass: fastd/mzigvpn
|
||||
dns:
|
||||
master: fd37:b4dc:4b1e::a25:103
|
||||
forward_zones:
|
||||
|
@ -106,11 +109,13 @@ meshes:
|
|||
peers:
|
||||
repo: https://github.com/freifunk-mwu/peers-ffwi.git
|
||||
version: master
|
||||
pass: fastd/wivpn
|
||||
- id: 1
|
||||
mtu: 1312
|
||||
peers:
|
||||
repo: https://github.com/freifunk-mwu/peers-ffwi.git
|
||||
version: master
|
||||
pass: fastd/wivpn
|
||||
intragate:
|
||||
instances:
|
||||
- id: 0
|
||||
|
@ -118,6 +123,7 @@ meshes:
|
|||
peers:
|
||||
repo: https://github.com/freifunk-mwu/ffwi-infrastructure-peers.git
|
||||
version: master
|
||||
pass: fastd/wiigvpn
|
||||
dns:
|
||||
master: fd56:b4dc:4b1e::a38:103
|
||||
forward_zones:
|
||||
|
|
|
@ -30,10 +30,4 @@ ffrl_exit_server:
|
|||
tunnel_ipv4_network: 100.64.9.50/31
|
||||
tunnel_ipv6_network: 2a03:2260:0:3c1::/64
|
||||
|
||||
fastd_secrets:
|
||||
mzvpn: "{{ lookup('passwordstore', 'fastd/mzvpn/uffschnitt subkey=secret') }}"
|
||||
wivpn: "{{ lookup('passwordstore', 'fastd/wivpn/uffschnitt subkey=secret') }}"
|
||||
mzigvpn: "{{ lookup('passwordstore', 'fastd/mzvpn/uffschnitt subkey=secret') }}"
|
||||
wiigvpn: "{{ lookup('passwordstore', 'fastd/wivpn/uffschnitt subkey=secret') }}"
|
||||
|
||||
tinc_private_key: "{{ lookup('passwordstore', 'tinc/icvpn/uffschnitt_private returnall=true') }}"
|
||||
|
|
|
@ -13,7 +13,7 @@ Diese Ansible role konfiguriert die fastd-Instanz für die Intra-Server Kommunik
|
|||
## Benötigte Variablen
|
||||
|
||||
- Dictionary `meshes`
|
||||
´´´
|
||||
```
|
||||
meshes:
|
||||
- id: xx
|
||||
...
|
||||
|
@ -26,26 +26,14 @@ meshes:
|
|||
peers:
|
||||
repo: # String - https Link zum Github Repository
|
||||
version: # String - Branch oder Commit ID
|
||||
pass: # String - Pfad des fastd secrets im Admin Pass
|
||||
...
|
||||
´´´
|
||||
- Dictionary `fastd_secrets` (Host-Variable)
|
||||
´´´
|
||||
fastd_secrets:
|
||||
mzigvpn: "{{ lookup('passwordstore', 'fastd/mzigvpn/sparegate4 subkey=secret') }}"
|
||||
wiigvpn: "{{ lookup('passwordstore', 'fastd/wiigvpn/sparegate4 subkey=secret') }}"
|
||||
...
|
||||
|
||||
´´´
|
||||
```
|
||||
|
||||
## fastd Secrets
|
||||
|
||||
Die privaten Schlüssel der fastd Instanzen sind sehr sensible Informationen, weshalb wir diese in ein nicht öffentliches passwordstore ausgelagert haben.
|
||||
Bevor man ein Gateway aufsetzt, müssen die privaten Schlüssel für alle benötigten fastd Instanzen generiert und im passwordstore hinterlegt werden.
|
||||
Das Dictionary `fastd_secrets` folgt dem Aufbau:
|
||||
```
|
||||
fastd_secrets:
|
||||
$Instanz-Name: "{{ lookup('passwordstore', '$Pfad-im-passwordstore subkey=secret') }}"
|
||||
```
|
||||
|
||||
## Abhängigkeiten
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{% set local_interface = item.0.id + 'igvpn' -%}
|
||||
#
|
||||
# {{ ansible_managed }}
|
||||
#
|
||||
{% for interface in fastd_secrets %}
|
||||
{% if local_interface == interface %}
|
||||
secret "{{ fastd_secrets[interface] }}";
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
secret "{{ lookup('passwordstore', item.1.pass + '/' + inventory_hostname_short + ' subkey=secret') }}";
|
||||
|
|
|
@ -17,7 +17,7 @@ Intragate-Instanzen: $mesh.id + 'ig' + vpn + '-' + $mesh.fastd.intragate.instanc
|
|||
## Benötigte Variablen
|
||||
|
||||
- Dictionary `meshes`
|
||||
´´´
|
||||
```
|
||||
meshes:
|
||||
- id: xx
|
||||
...
|
||||
|
@ -30,27 +30,15 @@ meshes:
|
|||
peers:
|
||||
repo: # String - https Link zum Github Repository
|
||||
version: # String - Branch oder Commit ID
|
||||
pass: # String - Pfad des fastd secrets im Admin Pass
|
||||
...
|
||||
´´´
|
||||
- Dictionary `fastd_secrets` (Host-Variable)
|
||||
´´´
|
||||
fastd_secrets:
|
||||
mzvpn: "{{ lookup('passwordstore', 'fastd/mzvpn/sparegate4 subkey=secret') }}"
|
||||
wivpn: "{{ lookup('passwordstore', 'fastd/wivpn/sparegate4 subkey=secret') }}"
|
||||
...
|
||||
|
||||
´´´
|
||||
```
|
||||
- Liste `legacy_gateways`
|
||||
|
||||
## fastd Secrets
|
||||
|
||||
Die privaten Schlüssel der fastd Instanzen sind sehr sensible Informationen, weshalb wir diese in ein nicht öffentliches passwordstore ausgelagert haben.
|
||||
Bevor man ein Gateway aufsetzt, müssen die privaten Schlüssel für alle benötigten fastd Instanzen generiert und im passwordstore hinterlegt werden.
|
||||
Das Dictionary `fastd_secrets` folgt dem Aufbau:
|
||||
```
|
||||
fastd_secrets:
|
||||
$Instanz-Name: "{{ lookup('passwordstore', '$Pfad-im-passwordstore subkey=secret') }}"
|
||||
```
|
||||
|
||||
## Abhängigkeiten
|
||||
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
{% set local_interface = item.0.id + 'vpn' -%}
|
||||
#
|
||||
# {{ ansible_managed }}
|
||||
#
|
||||
{% for interface in fastd_secrets %}
|
||||
{% if local_interface == interface %}
|
||||
secret "{{ fastd_secrets[interface] }}";
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
secret "{{ lookup('passwordstore', item.1.pass + '/' + inventory_hostname_short + ' subkey=secret') }}";
|
||||
|
|
Loading…
Reference in a new issue