From bcb0e23588ef9d372fbfac868c6932431118a21b Mon Sep 17 00:00:00 2001 From: h <9pfs@amcforum.wiki> Date: Sat, 25 Jan 2025 15:43:41 -0800 Subject: [PATCH] add mkpeerpsk.sh --- mkpeerpsk.sh | 7 +++++++ setup.yml | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 mkpeerpsk.sh diff --git a/mkpeerpsk.sh b/mkpeerpsk.sh new file mode 100644 index 0000000..e4a80c1 --- /dev/null +++ b/mkpeerpsk.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -x +cd /etc/systemd/network && \ +wg genpsk > "$1".psk && \ +chmod o-rwx "$1".psk && \ +chown root:systemd-network "$1".psk && \ +cat "$1".psk \ No newline at end of file diff --git a/setup.yml b/setup.yml index 8e8bf72..ae8bdf3 100644 --- a/setup.yml +++ b/setup.yml @@ -113,4 +113,9 @@ ansible.builtin.template: src: peerconf.sh.j2 dest: /usr/local/bin/peerconf.sh + mode: '0755' + - name: Push mkpeerpsk.sh to hosts + ansible.builtin.copy: + src: mkpeerpsk.sh + dest: /usr/local/bin/mkpeerpsk.sh mode: '0755' \ No newline at end of file