Bugfix: Iterating over clients now increment ip numbers ...

This commit is contained in:
Stefan Märkle 2020-12-28 18:21:19 +01:00
parent 0ba0c1ae16
commit 5dd380bcf1
2 changed files with 4 additions and 4 deletions

View File

@ -61,11 +61,11 @@
- name: generate client configs
template:
src: "wg0-client.conf"
dest: "~/wg/{{ item.item }}/wg0-client.conf"
dest: "~/wg/{{ item.1.item }}/wg0-client.conf"
owner: root
group: root
mode: 0600
with_items: "{{ vpn_client_private_keys.results }}"
with_indexed_items: "{{ vpn_client_private_keys.results }}"
- name: generate qr codes for client configs
shell: umask 077; qrencode --type=PNG --output=/root/wg/{{ item }}/wg0-client.png < ~/wg/{{ item }}/wg0-client.conf

View File

@ -1,7 +1,7 @@
[Interface]
Address = {{ vpn_network }}.{{item|int + 2}}/32
Address = {{ vpn_network }}.{{item.0 + 2}}/32
DNS = {{ dns_for_clients }}
PrivateKey = {{ item.stdout }}
PrivateKey = {{ item.1.stdout }}
[Peer]
PublicKey = {{ vpn_server_public_key.stdout }}