Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable skipping of wg kernel module install #200

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,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 @@ -71,6 +71,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