From 0b55139e6012145cff69e1192adda99b8571cda4 Mon Sep 17 00:00:00 2001 From: Benedikt Kristinsson Date: Fri, 18 Dec 2020 20:17:18 +0100 Subject: [PATCH] set pass for my user --- roles/common/tasks/common.yml | 14 +++++++------- roles/common/tasks/users.yml | 9 +++++++++ roles/vpnserver/templates/wg0.conf.j2 | 4 +--- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/roles/common/tasks/common.yml b/roles/common/tasks/common.yml index 80d20df..2ecd4bd 100644 --- a/roles/common/tasks/common.yml +++ b/roles/common/tasks/common.yml @@ -6,13 +6,13 @@ tags: - hostname -- name: set image hostname - hostname: - name: "sensor-image" - use: systemd - tags: - - never - - image +# - name: set image hostname +# hostname: +# name: "sensor-image" +# use: systemd +# tags: +# - never +# - image - name: copy ssh keys if known copy: diff --git a/roles/common/tasks/users.yml b/roles/common/tasks/users.yml index 47b5a6f..bfcb381 100644 --- a/roles/common/tasks/users.yml +++ b/roles/common/tasks/users.yml @@ -122,6 +122,15 @@ tags: - sshkeys +- name: set a password for {{ myusername }} + user: + name: "{{ myusername }}" + password: "{{ mypassword }}" + update_password: always + tags: + - human + - mypass + - name: set up system users block: diff --git a/roles/vpnserver/templates/wg0.conf.j2 b/roles/vpnserver/templates/wg0.conf.j2 index fb199bc..332e018 100644 --- a/roles/vpnserver/templates/wg0.conf.j2 +++ b/roles/vpnserver/templates/wg0.conf.j2 @@ -28,9 +28,7 @@ PersistentKeepalive = 240 # {{ peer }} [Peer] PublicKey = {{ lookup('file', 'private/wireguard/' + peer + '.pub' ) }} -{% set clients = [wireguard_clients[c].ip+"/32" for c in d.clients] %} -{% set ips = [d.ip + "/32"] + clients -AllowedIPs = {{ ips | join(", ") }} +AllowedIPs = {{ d.ip }}/32 {% endif %} {% endfor %} -- 2.40.1