Include needed scripts
This commit is contained in:
parent
35a6017f7d
commit
8ead2bc0fe
8
files/wg-sync.sh
Normal file
8
files/wg-sync.sh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
{
|
||||||
|
cat /etc/wg-adlin.conf
|
||||||
|
curl -s https://adlin.nemunai.re/api/wg.conf
|
||||||
|
|
||||||
|
} > /tmp/wg-adlin.conf &&
|
||||||
|
wg addconf wg-adlin /tmp/wg-adlin.conf
|
@ -94,7 +94,7 @@
|
|||||||
name: "{{ ctr_name }}"
|
name: "{{ ctr_name }}"
|
||||||
container_command: |
|
container_command: |
|
||||||
echo nameserver 192.168.0.254 > /etc/resolv.conf;
|
echo nameserver 192.168.0.254 > /etc/resolv.conf;
|
||||||
apk add --no-cache wireguard-tools-wg nftables;
|
apk add --no-cache curl wireguard-tools-wg nftables;
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Create symlink for service
|
- name: Create symlink for service
|
||||||
|
@ -15,11 +15,29 @@
|
|||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
# 3. Install others scripts
|
# 3. Install others scripts
|
||||||
|
- name: configure wg-adlin
|
||||||
|
copy:
|
||||||
|
src: "/etc/wireguard/wg-adlin.conf"
|
||||||
|
dest: "/var/lib/lxc/{{ ctr_name }}/rootfs/etc/wg-adlin.conf"
|
||||||
|
remote_src: true
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
|
||||||
|
- name: Copy wg-sync.sh
|
||||||
|
copy:
|
||||||
|
src: "wg-sync.sh"
|
||||||
|
dest: "/var/lib/lxc/{{ ctr_name }}/rootfs/root/wg-sync.sh"
|
||||||
|
mode: 0755
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
|
||||||
- name: Retrieve clean-wg.sh
|
- name: Retrieve clean-wg.sh
|
||||||
get_url:
|
get_url:
|
||||||
url: https://git.nemunai.re/teach/adlin/raw/branch/master/token-validator/clean-wg.sh
|
url: https://git.nemunai.re/teach/adlin/raw/branch/master/token-validator/clean-wg.sh
|
||||||
dest: "/var/lib/lxc/{{ ctr_name }}/rootfs/usr/sbin/clean-wg.sh"
|
dest: "/var/lib/lxc/{{ ctr_name }}/rootfs/usr/sbin/clean-wg.sh"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
|
||||||
- name: Add update-adlin script
|
- name: Add update-adlin script
|
||||||
template:
|
template:
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
name:
|
name:
|
||||||
- wireguard-tools-wg
|
- wireguard-tools-wg
|
||||||
state: present
|
state: present
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
|
||||||
- name: Enable IPv6 forwarding
|
- name: Enable IPv6 forwarding
|
||||||
ansible.posix.sysctl:
|
ansible.posix.sysctl:
|
||||||
@ -15,14 +17,20 @@
|
|||||||
file:
|
file:
|
||||||
path: /etc/wireguard
|
path: /etc/wireguard
|
||||||
state: directory
|
state: directory
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
|
||||||
- name: configure wg-adlin
|
- name: configure wg-adlin
|
||||||
template:
|
template:
|
||||||
src: "wg.conf.j2"
|
src: "wg.conf.j2"
|
||||||
dest: "/etc/wireguard/wg-adlin.conf"
|
dest: "/etc/wireguard/wg-adlin.conf"
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
|
||||||
- name: enable wg-adlin
|
- name: enable wg-adlin
|
||||||
template:
|
template:
|
||||||
src: networking.j2
|
src: networking.j2
|
||||||
dest: "/etc/network/interfaces.d/wg-adlin"
|
dest: "/etc/network/interfaces.d/wg-adlin"
|
||||||
notify: restart networking
|
notify: restart networking
|
||||||
|
tags:
|
||||||
|
- wireguard
|
||||||
|
Loading…
Reference in New Issue
Block a user