adc/ansible/roles/wg_vpn/tasks/main.yml
jowj ec8ea32089 Add ability to deploy matrix client from ansible
- add client_matrix.yml play
- add new ios.conf template
- update main.yml task to include matrix.conf template deploy and tags.
2020-01-14 15:42:22 -06:00

41 lines
1.1 KiB
YAML

---
# tasks file for wg_vpn
# playbook to go from a "base configured" server to a wg vpn peer
- name: add unstable to repos
shell: |
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
- name: install wireguard
apt:
name:
- wireguard
- build-essential
- dkms
update_cache: yes
state: latest
- name: Enable IP forwarding
sysctl: name={{ item }} value=1 state=present
with_items:
- net.ipv4.ip_forward
- net.ipv6.conf.all.forwarding
- name: Create wireguard config directory
file: state=directory path=/etc/wireguard owner=root group=root mode=0700
- name: Install wireguard configuration
template: src=wg0.conf dest=/etc/wireguard/wg0.conf owner=root group=root mode=0600
notify: restart wireguard
- name: Start wireguard
service: name=wg-quick@wg0.service enabled=yes state=started
- name: Create matrix.conf file in ~/wireguard/.
template: src=ios.conf dest=/etc/wireguard/ owner=root mode=0600
tags:
- clients
- client_matrix