From cee8668442abfe0a061545636499b10a53eb851e Mon Sep 17 00:00:00 2001 From: Tobias Date: Sat, 6 Jun 2026 15:03:32 +0100 Subject: [PATCH] Add playbooks/wg0_conf.yml --- playbooks/wg0_conf.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 playbooks/wg0_conf.yml diff --git a/playbooks/wg0_conf.yml b/playbooks/wg0_conf.yml new file mode 100644 index 0000000..d3fd055 --- /dev/null +++ b/playbooks/wg0_conf.yml @@ -0,0 +1,18 @@ +- name: configure wireguard + hosts: wireguard + become: true + + tasks: + - name: install wireguard configuration file + ansible.builtin.copy: + src: ../configs/wg0 + dest: /etc/wireguard/wg0.conf + owner: root + group: root + mode: 0600 + + - name: enter server private key into configuration file + shell: sed -i "4c PrivateKey = $(cat /etc/wireguard/server.private.key)" /etc/wireguard/wg0.conf + + - name: enter client public key into configuration file + shell: sed -i "14c PublicKey = $(cat /etc/wireguard/client.public.key)" /etc/wireguard/wg0.conf \ No newline at end of file