summaryrefslogtreecommitdiff
path: root/roles/wireguard
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2018-01-10 16:38:56 +0100
committerChristian Pointner <equinox@spreadspace.org>2018-01-10 16:38:56 +0100
commit6eecb484a4d81db8496eda44a257deca69229fdf (patch)
treef87e1ce52d12aa3d6d62de7221fc046720b9650a /roles/wireguard
parentinstall security updates in installer late_command (diff)
check if wireguard module build succeeded and retry build if necessary
Diffstat (limited to 'roles/wireguard')
-rw-r--r--roles/wireguard/tasks/main.yml17
1 files changed, 17 insertions, 0 deletions
diff --git a/roles/wireguard/tasks/main.yml b/roles/wireguard/tasks/main.yml
index 3dc63e64..a9d42b7b 100644
--- a/roles/wireguard/tasks/main.yml
+++ b/roles/wireguard/tasks/main.yml
@@ -6,3 +6,20 @@
with_items:
- wireguard-dkms
- wireguard-tools
+
+- name: check if module is available for the currently running kernel
+ command: modprobe --dry-run wireguard
+ check_mode: no
+ register: wireguard_module_available
+ failed_when: false
+ changed_when: false
+
+- name: rebuild wireguard module
+ when: wireguard_module_available.rc != 0
+ command: dpkg-reconfigure wireguard-dkms
+
+- name: check again if module is available for the currently running kernel
+ when: wireguard_module_available.rc != 0
+ command: modprobe --dry-run wireguard
+ check_mode: no
+ changed_when: false