Add mobile configuration & load keys from paths
This commit is contained in:
parent
16a979b04b
commit
56331232e6
13 changed files with 106 additions and 183 deletions
11
templates/mobile.wireguard.j2
Normal file
11
templates/mobile.wireguard.j2
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
|
||||
|
||||
[Interface]
|
||||
Address={{ vpn_peers.mobile.ip }}/24
|
||||
PrivateKey={{ vpn_peers.mobile.private_key }}
|
||||
|
||||
[Peer]
|
||||
PublicKey={{ vpn_server_public_key }}
|
||||
PresharedKey={{ vpn_peers.mobile.preshared_key }}
|
||||
AllowedIPs={{ vpn_listen_address }}/32
|
||||
Endpoint={{ wan_ip_address }}:{{ vpn_port }}
|
||||
|
|
@ -93,11 +93,11 @@ input {
|
|||
# blocks. Setting this block is optional, though the server will only attempt
|
||||
# autodetection for one sound card.
|
||||
#
|
||||
{% for peer in vpn_peers %}
|
||||
{% for peer, properties in vpn_peers.items() %}
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "Pulse remote {{ peer.name }}"
|
||||
server "{{ peer.ip }}"
|
||||
name "Pulse remote {{ peer }}"
|
||||
server "{{ properties.ip }}"
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ Description=WireGuard tunnel wg0
|
|||
ListenPort={{ vpn_port }}
|
||||
PrivateKey={{ vpn_server_key }}
|
||||
|
||||
{% for peer in vpn_peers %}
|
||||
{% for peer, properties in vpn_peers.items() %}
|
||||
[WireGuardPeer]
|
||||
PublicKey={{ peer.public_key }}
|
||||
PresharedKey={{ peer.preshared_key }}
|
||||
AllowedIPs={{ peer.ip }}/32
|
||||
PublicKey={{ properties.public_key }}
|
||||
PresharedKey={{ properties.preshared_key }}
|
||||
AllowedIPs={{ properties.ip }}/32
|
||||
{% if not loop.last %}
|
||||
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue