Skip to content

Commit

Permalink
Enabling skip of wg kernel module based on task, or documented role v…
Browse files Browse the repository at this point in the history
…ariable (#200)
  • Loading branch information
gregorydlogan authored Apr 22, 2024
1 parent f281bcf commit a1bc781
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ wireguard_interface_restart: false
# Set to "false" if package cache should not be updated (only relevant if
# the package manager in question supports this option)
wireguard_update_cache: "true"
# Normally the role installs and activates the wireguard kernel module where
# appropriate. In some cases we might not be able load kernel modules, like
# unprivileged LXC guests. If you set this to false you have to ensure
# the wireguard module is available in the kernel!
wireguard_install_kernel_module: true
```

There are also a few Linux distribution specific settings:
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ wireguard_interface_restart: false
# the package manager in question supports this option)
wireguard_update_cache: "true"

# Normally the role installs and activates the wireguard kernel module where
# appropriate. In some cases we might not be able load kernel modules, like
# unprivileged LXC guests. If you set this to false you have to ensure
# the wireguard module is available in the kernel!
wireguard_install_kernel_module: true

#######################################
# Settings only relevant for:
# - Ubuntu
Expand Down
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@
failed_when: wireguard__register_module_enabled is failure
tags:
- wg-install
when: not ansible_os_family == 'Darwin'
- wg-install-kernel-module
when:
- not ansible_os_family == 'Darwin'
- wireguard_install_kernel_module

- name: Set default for WireGuard interface restart behavior
ansible.builtin.set_fact:
Expand Down

0 comments on commit a1bc781

Please sign in to comment.