diff options
Diffstat (limited to 'roles/install_wg_prefix_provider')
-rw-r--r-- | roles/install_wg_prefix_provider/tasks/main.yml | 29 | ||||
-rw-r--r-- | roles/install_wg_prefix_provider/templates/wg_prefix_provider.service.j2 | 10 |
2 files changed, 39 insertions, 0 deletions
diff --git a/roles/install_wg_prefix_provider/tasks/main.yml b/roles/install_wg_prefix_provider/tasks/main.yml new file mode 100644 index 0000000..a155300 --- /dev/null +++ b/roles/install_wg_prefix_provider/tasks/main.yml @@ -0,0 +1,29 @@ +--- +- name: install wg_prefix_provider dependencies + pacman: + name: + - git + - make + - gcc + state: present + +- name: clone wg_prefix_provider repo + git: + repo: https://github.com/FreifunkMYK/wg_prefix_provider.git + dest: /opt/wg_prefix_provider + +- name: build wg_prefix_provider + make: + chdir: /opt/wg_prefix_provider + +- name: install wg_prefix_provider service + template: + src: wg_prefix_provider.service.j2 + dest: /etc/systemd/system/wg_prefix_provider.service + mode: 0644 + +- name: start and enable wg_prefix_provider service + systemd: + name: wg_prefix_provider + state: started + enabled: yes diff --git a/roles/install_wg_prefix_provider/templates/wg_prefix_provider.service.j2 b/roles/install_wg_prefix_provider/templates/wg_prefix_provider.service.j2 new file mode 100644 index 0000000..485517a --- /dev/null +++ b/roles/install_wg_prefix_provider/templates/wg_prefix_provider.service.j2 @@ -0,0 +1,10 @@ +[Unit] +Description=wg_prefix_provider +After=network.target + +[Service] +ExecStart=/opt/wg_prefix_provider/wg_prefix_provider wgmyk 9999 {{ wireguard_vpn_client_range }} +Restart=always + +[Install] +WantedBy=multi-user.target |