aboutsummaryrefslogtreecommitdiffstats
path: root/roles/wireguard/tasks/main.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-10 18:30:32 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-10 21:52:55 +0000
commitc1c300aa21b407351e6045c7b40480d4120db8a7 (patch)
tree48ac6715e649326d02dad7011b31c091db29b7b3 /roles/wireguard/tasks/main.yml
parent2fe1965dbb4cc650fda2b00e69219ac7ae403674 (diff)
downloadrules-c1c300aa21b407351e6045c7b40480d4120db8a7.tar.gz
roles: Generate + deploy wireguard configurations
Diffstat (limited to 'roles/wireguard/tasks/main.yml')
-rw-r--r--roles/wireguard/tasks/main.yml34
1 files changed, 34 insertions, 0 deletions
diff --git a/roles/wireguard/tasks/main.yml b/roles/wireguard/tasks/main.yml
new file mode 100644
index 0000000..9f1d01d
--- /dev/null
+++ b/roles/wireguard/tasks/main.yml
@@ -0,0 +1,34 @@
+- name: create local wireguard directory
+ file:
+ path: "{{ wireguard_local_dir }}"
+ state: directory
+ mode: 0700
+ run_once: true
+ delegate_to: localhost
+
+- name: create wireguard directory
+ file:
+ path: "{{ wireguard_dir }}"
+ owner: 0
+ group: 0
+ mode: 0700
+ state: directory
+
+- name: include key generation
+ include_tasks: keys.yml
+
+- name: include configuration generation
+ include_tasks: configuration.yml
+
+- name: install wireguard on remote host
+ package:
+ name: wireguard-tools
+ state: present
+
+- name: include service configuration for server
+ include_tasks: service.yml
+ when: inventory_hostname == wireguard_domain_controller
+
+- name: include service configuration for hosts
+ include_tasks: service.yml
+ when: inventory_hostname != wireguard_domain_controller
remember that computers suck.