You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
---
|
|
# tasks file for wg_vpn
|
|
# this is useful for running plays /from/ an arch machine that will join the wg net.
|
|
|
|
# install wg, generate keys, files on local machine
|
|
- name: (local) install wg (i use) arch (btw)
|
|
pacman:
|
|
update_cache: yes
|
|
name: wireguard-tools, wireguard-arch, wireguard-dkms
|
|
state: present
|
|
delegate_to: localhost
|
|
become: yes
|
|
# ansible has a hard time parsing the pacman files
|
|
# ignore errors once you verify shit is installed / patched.
|
|
ignore_errors: True
|
|
|
|
- name: (local) ensure /etc/wireguard/ exists
|
|
file:
|
|
path: /etc/wireguard/
|
|
state: directory
|
|
delegate_to: localhost
|
|
|
|
- name: (local) Generate keys
|
|
shell: |
|
|
printf "[Interface]\nPrivateKey = " > /etc/wireguard/wg0.conf
|
|
wg genkey | tee -a /etc/wireguard/wg0.conf | wg pubkey > /etc/wireguard/publickey
|
|
vars:
|
|
umask: "077"
|
|
delegate_to: localhost
|
|
become: yes
|
|
|
|
- name: (local) register publickey for later use
|
|
shell: cat /etc/wireguard/publickey
|
|
register: client_publickey
|
|
delegate_to: localhost
|
|
become: yes
|