diff options
author | Christian Pointner <equinox@spreadspace.org> | 2018-01-10 16:38:56 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2018-01-10 16:38:56 +0100 |
commit | 6eecb484a4d81db8496eda44a257deca69229fdf (patch) | |
tree | f87e1ce52d12aa3d6d62de7221fc046720b9650a /roles/wireguard | |
parent | install 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.yml | 17 |
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 |